diff options
author | Karl Berry <karl@freefriends.org> | 2006-08-27 22:38:54 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-08-27 22:38:54 +0000 |
commit | 2607d53137ede06e9780342b225218743e100bb4 (patch) | |
tree | c6c88c805dd21a5bbb6ad6f26d3d53c517f4b866 /Master/texmf-dist/tex/latex/oberdiek/bmpsize.sty | |
parent | fb0d58de45c0fc32bab09a839c186de46f75628e (diff) |
oberdiek update from tds zip (28aug06)
git-svn-id: svn://tug.org/texlive/trunk@2054 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/oberdiek/bmpsize.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/oberdiek/bmpsize.sty | 218 |
1 files changed, 218 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/oberdiek/bmpsize.sty b/Master/texmf-dist/tex/latex/oberdiek/bmpsize.sty new file mode 100644 index 00000000000..812028bf206 --- /dev/null +++ b/Master/texmf-dist/tex/latex/oberdiek/bmpsize.sty @@ -0,0 +1,218 @@ +%% +%% This is file `bmpsize.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% bmpsize.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright (C) 2006 by Heiko Oberdiek <oberdiek@uni-freiburg.de> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This Current Maintainer of this work is Heiko Oberdiek. +%% +%% This work consists of the main source file bmpsize.dtx +%% and the derived files +%% bmpsize.sty, bmpsize.pdf, bmpsize.ins, bmpsize.drv, +%% bmpsize-base.sty, bmpsize-test.tex, bmpsize-dvips.def, +%% bmpsize-dvipdfm.def, bmpsize-dvipdfmx.def. +%% +\ProvidesPackage{bmpsize}% + [2006/08/24 v1.0 Extract size and resolution data from bitmap files (HO)] +\RequirePackage{ifpdf} +\ifpdf + \PackageInfo{bmpsize}{Superseded by pdfTeX in PDF mode}% + \expandafter\endinput +\fi +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname pdffiledump\endcsname\relax + \PackageError{bmpsize}{% + You need pdfTeX 1.30.0 or newer% + }{Package loading is aborted.}% + \expandafter\endinput +\fi + +\RequirePackage{graphics} +\RequirePackage{keyval} +\RequirePackage{bmpsize-base} + +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname PackageWarning\endcsname\relax + \def\@bmpsize@warning#1#2{% + \begingroup + \newlinechar=10 % + \def\MessageBreak{% + ^^J% + (bmpsize) % + \space\space\space\space + \space\space\space\space + \space\space\space\space + \space\space\space + }% + \immediate\write16{% + Package bmpsize Warning: #2 % + on input line \the\inputlineno.% + }% + \endgroup + }% +\else + \def\@bmpsize@warning{\PackageWarning{bmpsize}}% +\fi + +\InputIfFileExists{bmpsize-\Gin@driver}{}{} + +\define@key{Gin}{bmpsizefast}[true]{% + \expandafter\ifx\csname if#1\expandafter\endcsname\csname iftrue\endcsname + \@bmpsize@fasttrue + \else + \@bmpsize@fastfalse + \fi +} +\define@key{Gin}{resolutionunit}{% + \def\bmpsize@unit@default{#1}% +} +\begingroup + \def\x#1{\endgroup + \define@key{Gin}{resolution}{% + \@bmpsize@read@resolution\@bmpsize@user@resolutiontrue##1#1#1\@nil + }% + \define@key{Gin}{defaultresolution}{% + \@bmpsize@read@resolution\@bmpsize@user@resolutionfalse##1#1#1\@nil + }% + }% +\x{ } +\def\@bmpsize@read@resolution#1#2 #3 #4\@nil{% + \ifcase 0\ifx\\#2\\1\fi + \ifnum\pdfstrcmp{#2}{\Gin@exclamation}=\z@ + \ifx\\#3\\1\fi + \ifnum\pdfstrcmp{#3}{\Gin@exclamation}=\z@ + 1% + \fi + \fi + \ifcase\pdfstrcmp{#2}{\Gin@exclamation}\relax + \let\bmpsize@pixelx@default\Gin@exclamation + \else + \edef\bmpsize@pixelx@default{#2}% + \fi + \ifcase\pdfstrcmp{#3}{\Gin@exclamation}\relax + \let\bmpsize@pixely@default\Gin@exclamation + \else + \ifx\\#3\\% + \let\bmpsize@pixely@default\bmpsize@pixelx@default + \else + \edef\bmpsize@pixely@default{#3}% + \fi + \fi + #1% + \else + \PackageError{bmpsize}{% + Wrong syntax for key (default)resolution% + }{% + See package documentation for correct syntax.% + }% + \fi +} +\newcommand*{\bmpsizesetup}{\setkeys{Gin}} + +\let\@bmpsize@org@setfile\Gin@setfile +\def\Gin@setfile#1#2#3{% + \ifcase\pdfstrcmp{#1}{bmp}\relax + \expandafter\@firstofone + \else + \expandafter\@gobble + \fi + {% + \bmpsize@okfalse + \edef\bmpsize@ext{\ifx\Gin@ext\relax\Gin@eext\else\Gin@ext\fi}% + \edef\bmpsize@file{\Gin@base\bmpsize@ext}% + \edef\@bmpsize@temp{\bmpsize@ext}% + \@ifundefined{bmpsize@read@\@bmpsize@temp}{% + \@ifundefined{bmpsize@map@\@bmpsize@temp}{}{% + \expandafter\let\expandafter\@bmpsize@temp + \csname bmpsize@map@\@bmpsize@temp\endcsname + }% + }{}% + \@ifundefined{bmpsize@read@\@bmpsize@temp}{% + }{% + \csname bmpsize@read@\@bmpsize@temp\endcsname\bmpsize@file + }% + \ifbmpsize@ok + \else + \@for\@bmpsize@temp:=\bmpsize@types\do{% + \ifbmpsize@ok + \else + \csname bmpsize@read@\@bmpsize@temp\endcsname\bmpsize@file + \fi + }% + \fi + \ifbmpsize@ok + \ifGin@bbox + \@ifundefined{Gin@vllx}{% + \@bmpsize@warning{Explicit bounding box is ignored}% + }{% + \ifx\Gin@viewport@code\relax + \def\Gin@ollx{0}% + \let\Gin@olly\Gin@ollx + \let\Gin@ourx\bmpsize@width + \let\Gin@oury\bmpsize@height + \let\Gin@vllx\Gin@llx + \let\Gin@vlly\Gin@lly + \let\Gin@vurx\Gin@urx + \let\Gin@vury\Gin@ury + \let\Gin@viewport@code\Gin@viewport + \@bmpsize@warning{% + Explicit bounding box replaced by\MessageBreak + viewport setting + }% + \else + \@bmpsize@warning{Explicit bounding box is ignored}% + \fi + }% + \fi + \def\Gin@llx{0}% + \def\Gin@lly{0}% + \let\Gin@urx\bmpsize@width + \let\Gin@ury\bmpsize@height + \Gin@bboxtrue + \else + \PackageInfo{bmpsize}{Unknown image type of \bmpsize@file}% + \fi + }% + \@bmpsize@org@setfile{#1}{#2}{#3}% +} +\newcommand*{\bmpsize@ext@type}[1]{% + \@namedef{bmpsize@map@#1}% +} +\bmpsize@ext@type{.jpg}{jpg} +\bmpsize@ext@type{.jpe}{jpg} +\bmpsize@ext@type{.jfif}{jpg} +\bmpsize@ext@type{.jpeg}{jpg} +\bmpsize@ext@type{.tif}{tiff} +\bmpsize@ext@type{.tiff}{tiff} +\bmpsize@ext@type{.pcx}{pcx} +\bmpsize@ext@type{.msp}{msp} +\bmpsize@ext@type{.bmp}{bmp} +\bmpsize@ext@type{.png}{png} +\bmpsize@ext@type{.pnm}{pnm} +\bmpsize@ext@type{.pbm}{pnm} +\bmpsize@ext@type{.pgm}{pnm} +\bmpsize@ext@type{.ppm}{pnm} +\bmpsize@ext@type{.pam}{pam} +\bmpsize@ext@type{.xpm}{xpm} +\bmpsize@ext@type{.gif}{gif} +\bmpsize@ext@type{.tga}{tga} +\bmpsize@ext@type{.sgi}{sgi} +\endinput +%% +%% End of file `bmpsize.sty'. |