imgsizer-2.7/0040755000002700000270000000000010104544725011355 5ustar esresrimgsizer-2.7/README0100444000002700000270000000222610104544725012232 0ustar esresr imgsizer -- autogenerate WIDTH and HEIGHT for IMG tags This is a nifty little HTML authoring tool that will generate correct Netscape-style WIDTH and HEIGHT parameters for each of your IMG tags. This will enable the text parts of your page to load much faster. Files in this directory: README -- this file imgsizer -- the utility imgsizer.xml -- manual page in XML-DocBook RefEntry format Makefile -- installation and packaging productions Put imgsizer on your execution path and the man page in a man source directory somewhere. `make install' will do the right thing on a Linux box. That's it. You will need either identify(1) from the ImageMagick tools or rdjpgcom(1) and a modern version of file(1) to make this work. If you are using Linux or any of the free BSDs these tools are probably already on your system; otherwise, you should be able to get identify(1) from ftp://ftp.x.org/contrib/applications/ImageMagick. Usual open-source terms -- copy, use, and redistribute as you like, don't take my name off it, and clearly mark any modified versions. Fixes and enhancements cheerfully accepted. Enjoy! -- esr http://www.catb.org/~esr imgsizer-2.7/COPYING0100644000002700000270000004311010104544725012404 0ustar esresr GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. imgsizer-2.7/Makefile0100644000002700000270000000225510104544725013016 0ustar esresr# Makefile for the imgsizer distribution VERS=$(shell sed test-after.html diff -c test-after.html test-converted.html dist: imgsizer-$(VERS).tar.gz release: imgsizer-$(VERS).tar.gz imgsizer.html shipper -f; rm -f CHANGES ANNOUNCE* *.1 *.html *.rpm *.lsm imgsizer-2.7/imgsizer.spec0100644000002700000270000000227510104544725014065 0ustar esresrName: imgsizer Version: 2.7 Release: 1 Summary: compute WIDTH and HEIGHT attribues for IMG tags URL: http://www.catb.org/~esr/imgsizer/ Source: %{name}-%{version}.tar.gz License: MIT-like Group: Utilities/System BuildRoot: %{_tmppath}/%{name}-root #Keywords: web, images, optimization %description This tool auto-generates or corrects WIDTH and HEIGHT parameters into HTML IMG tags, making page loading faster. %prep %setup -q %build make %{?_smp_mflags} imgsizer.1 %install [ "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf "$RPM_BUILD_ROOT" mkdir -p "$RPM_BUILD_ROOT"%{_bindir} mkdir -p "$RPM_BUILD_ROOT"%{_mandir}/man1/ cp imgsizer "$RPM_BUILD_ROOT"%{_bindir} cp imgsizer.1 "$RPM_BUILD_ROOT"%{_mandir}/man1/ %clean [ "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf "$RPM_BUILD_ROOT" %files %doc README COPYING %defattr(-,root,root,-) %{_mandir}/man1/imgsizer.1* %{_bindir}/imgsizer %changelog * Thu Aug 5 2004 Eric S. Raymond - 2.7-1 - Added capability to use PIL if both file(1) and identify(1) fail. Added BUGS section to manual page. * Mon Dec 29 2003 Eric S. Raymond 2.6-1 - Source RPMs no longer depend on --define myversion. imgsizer-2.7/imgsizer0100555000002700000270000002422010104544725013127 0ustar esresr#!/usr/bin/python # # imgsizer -- correct image sizes in WWW pages # by Eric S. Raymond # # Fix up IMG tags in given documents to contain correct sizes. # # Works with Python 1.5.2 # # Copy, use, and redistribute freely, but don't take my name off it and # clearly mark an altered version. Fixes and enhancements cheerfully # accepted. # # Changelog: # # Originally created by Eric S. Raymond 30 Jul 1996 # # Modified by Erik Rossen 15 May 1999 # # Added the --nomagick switch, to use file(1) and rdjpgcom(1) # to determine the image size instead of identify(1) from the # ImageMagick suite. # # Modified by Michael C. Toren 18 Aug 2000 # # Fixed bug where the SRC attribute's value needed to be in quotes, # improved command line parsing (but it could still use some work), # added -q switch to omit quotes when generating tags, and -l switch # to generate lowercase tags. -mct # # Modified by Michael C. Toren 19 Aug 2000 # # Improved the command line parsing some more, now looks for additional # arguments via an IMGSIZER environmental variable, added the -d switch # to set the DocumentRoot, -v switch to display version information, # and -h switch to display usage information. -mct # # Modified by Michael C. Toren 23 Feb 2001 # # Fixed two bugs reported by Jeroen Valcke , one # where the -d switch did not function properly if the img src attribute # was quoted, and another where the &error sub was incorrectly reporting # the line number an error occurred due to the input record separator # being set to ">". # # Rewritten in Python by Eric S. Raymond 11 July 2001 # # Time to get rid of the dependency on httpget. The -l option is gone, too; # instead, we deduce the right case by looking at the leading tag. -q # is gone; we always emit without quotes. -m is gone too, instead we # try commands in least to most expensive order, and notice when a command # returns not to try it again. # # Fixes by ESR, 29 July 2001 # # Incorporated fixes by Peter S. Galbraith. # # Fixes by ESR, 25 April 2003 # # Merged amended versions of Lennart Poettering's fix for Debian bug 139714. # and Jeroen N. Witmond's fix for Debian bug 168964. Added regression-test # production. # # Enhancement by ESR, 14 Nov 2003 # # Verify and merge Lucien Saviot's patch to produce XHTML from XHTML input. # Also his change to handle spurious lin e breaks produced by Dave Raggett's # tidy(1) utility. # # Modified by Andrew Gwozdziewycz , 17 June 2004 # # Added support for the Python Imaging Library to determine size in case of # failure from file(1), rdjpgcom(1) and identify(1). import sys, os, getopt, string, re, urllib, commands # Arrange for both 1.5 and 2.1 compatibility try: import filecmp cmp = filecmp del filecmp except ImportError: import cmp version = "2.7, 05 Aug 2004"; splash = """imgsizer version %s, Eric S. Raymond See for updates.""" usage = """Usage: imgsizer [OPTIONS] [HTML File] Options: -V, --version Display version information and exit. -h, --help Display usage information. -d , --document-root Directory where absolute image filenames (i.e, ones which contain a leading "/") may be found. -n, --no-overwrite Don't overwrite existing width and height tags if both are present. """ # Optimization latches -- if an attempt to invoke a command returns 127 # "not found" there will turn off and that command won't be tried again. magick = 1 # using ImageMagick by default rdjpgcom = 1 # using rdjpcom by default pythonimage = 1 # use python imaging library def attrformat(xc, dim): if lower: res = " " + dim else: res = " " + string.upper(dim) res = res + '="' + str(xc) + '"' return res def sizefix(infp, outfp): # Apply attrfix to the attributes in each image tag global lower while 1: ch = infp.read(1) if ch == '': return outfp.write(ch) if ch == '<': # within an HTML tag lead = infp.read(2) outfp.write(lead) if not lead in ("im", "IM"): continue # splitting the read this way copes with single-char tags like lead = lead + infp.read(1) outfp.write(lead[-1]) if not lead in ("img", "IMG"): continue # within an image tag lower = (lead == 'img') state = suppress = 0 attributes = "" while 1: ch = infp.read(1) if ch == '': return if ch == '>': break if ch == '/': ch2 = infp.read(1) ch = ch + ch2 if ch2 == '>': break attributes = attributes + ch outfp.write(transform(attributes) + ch) x_match = re.compile (r" ([0-9]+) *x *([0-9]+)") rdjpg_match = re.compile (r" ([0-9]+)w *\* *([0-9]+)h") def imgsize(src): "Return the image size in pixels for a given image source." global magick, rdjpgcom, pythonimage try: (filename, headers) = urllib.urlretrieve(src) except IOError: return None # Now let's see if we can get a size for the retrieved image. # Try file(1) first -- cheapest, as it doesn't read the whole image (status, output) = commands.getstatusoutput("file " + filename) if status == 0: # file(1) works for every common image format other than JPEG if string.find(output, "JPEG") == -1: sizes = x_match.search(output) if sizes: return (sizes.group(1), sizes.group(2)) elif rdjpgcom: # Use rdjpgcom(1) to handle JPEGs (status, output) = commands.getstatusoutput("rdjpgcom -verbose " + filename) sizes = rdjpg_match.search(output) if sizes: return (sizes.group(1), sizes.group(2)) elif status == 127: rdjpgcom = 0 # Next try identify(1), more expensive but bulletproof if magick: (status, output) = commands.getstatusoutput("identify " + filename) if status == 0: sizes = x_match.search(output) if sizes: return (sizes.group(1), sizes.group(2)) elif status == 127: sys.stderr.write("imgsizer: giving up on ImageMagick\n") magick = 0 # if that fails, try at _LAST_ resort Python Imaging Library # open doesn't actually load all the data, so it shouldn't be too expensive if pythonimage: try: import Image pyimg = Image.open(filename) return pyimg.size except (ImportError, IOError): sys.stderr.write("imgsizer: giving up on Python Imaging Library\n") pythonimage = 0 pass # All attempts failed sys.stderr.write("imgsizer: couldn't analyze %s\n" % src) source = re.compile('SRC\s*=\s*"?([^" \t\n]*)"?', re.I) awidth = re.compile(r' *WIDTH\s*=\s*"?[0-9]*"?', re.I) aheight = re.compile(r' *HEIGHT\s*=\s*"?[0-9]*"?', re.I) pwidth = re.compile(r'WIDTH\s*=\s*"?[0-9]*%"?', re.I) pheight = re.compile(r'HEIGHT\s*=\s*"?[0-9]*%"?', re.I) def transform(attr): src = source.search(attr) # Must have a source part and no percents in existing width or height if not src or pwidth.search(attr) or pheight.search(attr): return attr if no_overwrite and awidth.search(attr) and aheight.search(attr): return attr # Correct the url for documentation root, if present url = src.group(1) if url[0] == '/' and root: url = os.path.join(root, url[1:]) # OK, get the size tuple if possible dimensions = imgsize(url) if not dimensions: return attr else: # Nuke any old size attr if not no_overwrite: attr = re.sub(awidth, "", attr) attr = re.sub(aheight, "", attr) # Compute image dimensions (xc, yc) = dimensions # Plug in the new attr return attr + attrformat(xc, "width") + attrformat(yc, "height") # Output uppercase tags, surrounded by quotes, by default. lower = 0 quotes = 1 # Set the default DocumentRoot to the current working directory. root = "." out = "imgsizer-out$$" dir = "." # NOTE: if you are doing imgsizer 1 6 Sep 2001 imgsizer automatically splice in height and width params for HTML IMG tags imgsizer file --document-root file file --help file HTMLFile file --version OPTIONS -V, --version Display version information and exit. -h, --help Display usage information. -d <directory>, --document-root <directory> Directory where absolute image filenames (i.e, ones which contain a leading "/") may be found. -n, --no-overwwrite .SH DESCRIPTION The imgsizer script automates away the tedious task of creating and updating the extension HEIGHT and WIDTH parameters in HTML IMG tags. These parameters help many browsers (including the Netscape/Mozilla family) to multi-thread image loading, instead of having to load images in strict sequence in order to have each one's dimensions available so the next can be placed. This generally allows text on the remainder of the page to load much faster. This script will try create such attributes for any IMG tag that lacks them. It will correct existing HEIGHT and WIDTH tags unless either contains a percent (%) sign, in which case the existing dimensions are presumed to be relative and left unaltered. This script may be called with no arguments. In this mode, it filters HTML presented on stdin to HTML (unaltered except for added or corrected HEIGHT and WIDTH attributes) on stdout. If called with file arguments, it will attempt to transform each file in place. Each argument file is not actually modified until the script completes a successful conversion pass. The <directory> option sets the DocumentRoot, where images with an absolute filename (i.e., ones which contain a leading "/") may be found. If none is specified, the DocumentRoot defaults to the current working directory. The -n (no-overwrite) opion prevents the program from overwriting existing width and height tags if both are present. Additional options may also be specified in the environmental variable "IMGSIZER". For example, to avoid typing "imgsizer /var/www/docs" each time imgsizer is invoked, you might tell sh (or one of its descendants): IMGSIZER="-d /var/www/docs"; export IMGSIZER or, if you use csh: setenv IMGSIZER "-d /var/www/docs" This script is written in Python, and thus requires a Python interpreter on the host system. It also requires either the identify1 utility distributed in the open-source ImageMagick suite of image-display and manipulation tools, or a modern version of file1 and rdjpgcom1. These utilities are used to extract sizes from the images; imgsizer itself has no knowledge of graphics formats. The script will handle any image format known to identify1 including PNG, GIF, JPEG, XBM, XPM, PostScript, BMP, TIFF, and anything else even remotely likely to show up as an inline image. NOTE The -q, -l, and -m options of the 1.0 versions are gone. What they used to do has been made unnecessary by smarter logic. BUGS The code uses regular expressions rather than true HTML/XML parsing. Some perverse but legal constructions, like extraneous space within quoted numeric attributes, will be mangled. AUTHOR Originally created by Eric S. Raymond <esr@thyrsus.com>. Additional code contributed by Erik Rossen, Michael C. Toren <michael@toren.net>, and others. For updates, see <http://www.catb.org/~esr> SEE ALSO identify1, file1, rdjpgcom(1). imgsizer-2.7/test-before.html0100644000002700000270000000224210104544725014457 0ustar esresrImgsizer Testfile Ok: absolute URL

Error: no src-tag

Warn: no quotes (we don't insert them)

A tag (alt), which should be skipped by imgsize
Dummy Picture
Warn: whitespace

Warn: whitespace and a newline

Ok: relative URL

Ok: also relative

Don't overwrite an existing single width-tag
Imgsizer should calculate the height-tag
Warn: A single existing height-tag
should be ignored and overwritten.
Both tags given: Don't overwrite anything

Paranoia ;-)

A given relative width
the img should be skipped.
Try a JPEG imgsizer-2.7/test-converted.html0100644000002700000270000000243710104544725015214 0ustar esresrImgsizer Testfile Ok: absolute URL

Error: no src-tag

Warn: no quotes (we don't insert them)

A tag (alt), which should be skipped by imgsize
Dummy Picture
Warn: whitespace

Warn: whitespace and a newline

Ok: relative URL

Ok: also relative

Don't overwrite an existing single width-tag
Imgsizer should calculate the height-tag
Warn: A single existing height-tag
should be ignored and overwritten.
Both tags given: Don't overwrite anything

Paranoia ;-)

A given relative width
the img should be skipped.
Try a JPEG imgsizer-2.7/test.png0100644000002700000270000000766010104544725013050 0ustar esresrPNG  IHDR@ș`PLTEfD3UUU"3DDU"f""w""3333D3D3DDUDUwffݙDfUU"̻DDD333"""#tEXtSoftwaregif2png 0.6 (beta)iIDATx흋v:EV{j3֮4|\ H$D"H$D"H$D"H$D"H$D"H$D"H$D"H$D"H$D"H$D"H$8mQfY*L*M$W|[EI?|^?ACS{nC&jo&DP I 1Ƅ&~YvEZv(Šq!ګ*9ɱQmpn#S>+ihѬC"Дg;pnBjr.FXnFN@()vEK*`[2 >&l_$N% ;A&7M.G]eNf,`OvL.V>e kGiډǕpvi$X<Ӯt bƏmقke{0 vGOY4˻6GT$/I 2K[U##7 v̋=xw*׫y;D_܄dFpL^a]?:F5aCNsdhuXve/,CSkyj6B M#wEQt Z aTYg]C8'6W_Ӵ~3Hp/qj'@j Smu.K \6.6[i .A}`h6ږ[ Pė[߲&%BE.RX 1k~eFz\ #|%eY{屲)ܻBz%2ř;HO/ꕥ^X@ NEQ.06- /6{-D*QL/j}O|1SQ]U]H8ΜC7Tɛ~BsTW|#} ח-[Y`(Ηr9ϗeqnkʑ_(59Vl/{'lͪ$gdw9-p{!ݐpb0X:~=Ɋ|y qQǀ=1tKe_Z%5#n~}A~}XO}仵_>[.k`eF]fb0O+b5`ǂ`Wzmaj0z0.%0 zv^.Egs;D(|N܆`$Ax_Mom4NhP@(r^׮m[rK3e _I%m5y ;Mc.%t>5~smN)$M[$QK)NȖVWw&"\ h3[>9z!B0Mm}X`l.l' h_W`J3/C@wiP!WO0zZUlwS'OWA~K`[ӄ['QFN463ZgvA6K`dʤ.5xG F0}bV Q,akPu?HMM'`SaX˗ eQscB\vQ~{Yq[k:Z;kz'薆r`H+=r锩Ͻ,@/v/K`8,@d4a~8ۦ>b_qZnv^e8Η0j~~*4,7H ~]+~7Vx I; .S1gaCm8T&X3~dW`(Bn0AS}ROwjam8ˬ y%1@+#iŷ^B豒>Oa\G.窒DwYWwcoG}/V E .,tl}V'iT,P(GkPtZu&#'Jø| ,Poֱ_r[rBA8WR L|2;PCrg.;1Iye C~z >Uhm/+9NtZI0*ө^\kT{S)=ҩ8]OeVȗ)MJa1;]ƭj|r~W_zMӫ^k|uW}۸ѪF՗ϩCxĝ?Wy|wՕNF|ºW1??'lMW|MxV#]־R})y۾>$Pת)y:}̊Q1 }/l nk~*ބz3wקShzطǤ}wg'泔zC),gا=Mn>7hzjݾ {l^vI N,c槺]ow4F£z=|6|ФLĖ9ׂ0WpL"3Eg*x>%8SCD"HgIzV[73Ҁawj~a7ҠT53G_i׈D`Pu9;C|l!IENDB`imgsizer-2.7/tnhd2.jpg0100644000002700000270000012616210104544725013103 0ustar esresrJFIFFCREATOR: XV Version 3.00 Rev: 3/30/93 Quality = 75, Smoothing = 0 C    $.' ",#(7),01444'9=82<.342C  2!!22222222222222222222222222222222222222222222222222W}" }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ?րOI֔t :PNz@!?('t 4@)A8qGҁCK)1p+!1(KF QR?:(7 CKҊ1_E( t~cSGZ@!)hCA LQZ>bJQҔg{ŲizvG:F@\I sWNzPwkHaAST5mCZ9{QF7wiLzR)zMaN?RHw7=Hi!sQOrAxc= 89#9A̲jvH`d- {]Bi$">IZoxbG+fI.H|;[+ m%KܤtǰQdܭc^1KfŽ)GȠt0fTVbpOK; 3ƛ#hE^z #iܬ -, N+R 2SIծM2)fP`QּU6M½dIS>eqii: ! O@2h#4'mǤt]za}]6׏xf}Zf2ϖ|5CMllf")Ll4MATu 4Pފ QKIE1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;uO[_蠎F~|#6ݷ~[&Hؼxޥ{u-F]Q}k &cx7zq#;XUQNGj˒Y[rO [=rISj:% %s+ H]X&" GI8ͼ?^MO#)=6}x?{ơI] иP;|Ky^EKmn*sbXu_M,~uҰ<auxf+[ȚW%}k^ѳX|'uu })~Հ?)fV bR_:Qך871|CJiךtJ^ԀN(b3_Ú$4iVnw34C$j坝>M Y'b.Oz Znr{Y $&DWGeaGWM'N[yF6"I6m-򭠎󝑨֤(扣qVSG [[ hf-J]LM%,U@QVHZ( QE/cZZ1;hRSljj)VB!*zE.QKp (PKp3\RSmzRt.( ~4`R4=-hi94bҀI]?*Z)݌L~fCzi1ҜM!UC7=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "IMGSIZER" 1 "" "" "" .SH NAME imgsizer \- automatically splice in height and width params for HTML IMG tags .SH "SYNOPSIS" .ad l .hy 0 .HP 9 \fBimgsizer\fR [\fB\-d\fR\ \fIfile\fR] [\-\-document\-root\ \fIfile\fR] [\fB\-h\fR\ \fIfile\fR] [\-\-help\ \fIfile\fR] [\fB\-n\fR] [\fB\-\-no\-overwrite\fR] [\fIHTMLFile\fR] [\fB\-v\fR\ \fIfile\fR] [\-\-version] .ad .hy .SH "OPTIONS" .TP .ad l .hy 0 .HP 1 \-V, \-\-version .ad .hy Display version information and exit\&. .TP .ad l .hy 0 .HP 1 \-h, \-\-help .ad .hy Display usage information\&. .TP .ad l .hy 0 .HP 1 \-d\ \fI,\fR \-\-document\-root\ \fI\fR .ad .hy Directory where absolute image filenames (i\&.e, ones which contain a leading "/") may be found\&. .TP \-n, \-\-no\-overwwrite, \&.SH DESCRIPTION The \fBimgsizer\fR script automates away the tedious task of creating and updating the extension HEIGHT and WIDTH parameters in HTML IMG tags\&. These parameters help many browsers (including the Netscape/Mozilla family) to multi\-thread image loading, instead of having to load images in strict sequence in order to have each one's dimensions available so the next can be placed\&. This generally allows text on the remainder of the page to load much faster\&. .PP This script will try create such attributes for any IMG tag that lacks them\&. It will correct existing HEIGHT and WIDTH tags unless either contains a percent (%) sign, in which case the existing dimensions are presumed to be relative and left unaltered\&. .PP This script may be called with no arguments\&. In this mode, it filters HTML presented on stdin to HTML (unaltered except for added or corrected HEIGHT and WIDTH attributes) on stdout\&. If called with file arguments, it will attempt to transform each file in place\&. Each argument file is not actually modified until the script completes a successful conversion pass\&. .PP The \fB\-d\fR option sets the DocumentRoot, where images with an absolute filename (i\&.e\&., ones which contain a leading "/") may be found\&. If none is specified, the DocumentRoot defaults to the current working directory\&. .PP The \-n (no\-overwrite) opion prevents the program from overwriting existing width and height tags if both are present\&. .PP Additional options may also be specified in the environmental variable "IMGSIZER"\&. For example, to avoid typing "imgsizer \fB\-d\fR /var/www/docs" each time \fBimgsizer\fR is invoked, you might tell sh (or one of its descendants): .nf IMGSIZER="\-d /var/www/docs"; export IMGSIZER .fi .PP or, if you use csh: .nf setenv IMGSIZER "\-d /var/www/docs" .fi .PP This script is written in Python, and thus requires a Python interpreter on the host system\&. It also requires either the \fBidentify\fR(1) utility distributed in the open\-source ImageMagick suite of image\-display and manipulation tools, or a modern version of \fBfile\fR(1) and \fBrdjpgcom\fR(1)\&. These utilities are used to extract sizes from the images; \fBimgsizer\fR itself has no knowledge of graphics formats\&. The script will handle any image format known to \fBidentify\fR(1) including PNG, GIF, JPEG, XBM, XPM, PostScript, BMP, TIFF, and anything else even remotely likely to show up as an inline image\&. .SH "NOTE" .PP The \-q, \-l, and \-m options of the 1\&.0 versions are gone\&. What they used to do has been made unnecessary by smarter logic\&. .SH "BUGS" .PP The code uses regular expressions rather than true HTML/XML parsing\&. Some perverse but legal constructions, like extraneous space within quoted numeric attributes, will be mangled\&. .SH "AUTHOR" .PP Originally created by Eric S\&. Raymond \&. Additional code contributed by Erik Rossen, Michael C\&. Toren , and others\&. For updates, see .SH "SEE ALSO" .PP \fBidentify\fR(1), \fBfile\fR(1), rdjpgcom(1)\&.