commit a7440f2b7aa6cc5a014508c4480e3660eaab0e03 Author: Toshaan Bharvani Date: Thu Mar 9 17:07:15 2023 +0100 add missing source Signed-off-by: Toshaan Bharvani diff --git a/SOURCES/pngcrush.sgml b/SOURCES/pngcrush.sgml new file mode 100644 index 0000000..b4717fd --- /dev/null +++ b/SOURCES/pngcrush.sgml @@ -0,0 +1,549 @@ + + David"> + Whedon"> + + Mon Apr 30, 2001"> + + 1"> + dwhedon@gordian.com"> + + pngcrush"> + pngcrush"> + + Debian GNU/Linux"> + GNU"> +]> + + + +
+ &dhemail; +
+ + &dhfirstname; + &dhsurname; + + + 2000 + &dhusername; + + &dhdate; +
+ + &dhucpackage; + + &dhsection; + + + pngcrush + + optimizes (or modifies) PNG (Portable Network Graphics) files. + + + + pngcrush + + + infile.png + outfile.png + + + pngcrush -e ext + + file1.png + file2.png + ... + + + pngcrush -d dir + + file1.png + file2.png + ... + + + + DESCRIPTION + &pngc; is an optimizer for PNG (Portable Network Graphics) files. Its +main purpose is to reduce the size of the file's IDAT chunk (or stream). &pngc; can also be used to modify a PNG's ancillary chunks (example: transparency information or textual comments). Some familiarity with the PNG (pronounced 'ping') format may be helpful to users of &pngc;. &pngc; has reasonable defaults so running with no options may produce smaller files. This document briefly describes the PNG format where necessary to understand &pngc;. For complete documentation, see : + +http://www.libpng.org/pub/png/. + + The actual pixel data of a PNG is contained in one or many IDAT chunks. To make an IDAT chunk PNG encoders take the raw pixel data, filter it with one of 5 different filters (See Section ) then compress it. &pngc; reduces the size of PNG files by choosing a different filter or compression methods from those used in the input file. &pngc; tries multiple filter/compression methods and compares the size of the resulting IDAT chunk. The filter/compression method with the smallest IDAT chunk is chosen for the output file. The filter and compression levels &pngc; tries are controlled by command line options. All of the filter methods and compression levels are lossless; they will not reduce image quality. + In addition to reducing the size of a PNG file, &pngc; can modify ancillary chunks. Ancillary chunks are optional information including transparency (tRNS), gamma (gAMMA), standard RGB color space conformance (sRGB) or textual information (iTXt, tEXt or zTXt). See the associated command line options for details on manipulating these chunks. + + + OPTIONS + + + + + + If file has an IDAT chunk greater than the integer size, it will be considered to be already crushed and will not be processed further. + + + + + + +Force output bit depth to n. See Section for bit depth restrictions. + + + + + + + +Specify the default background color for the image. Some PNG viewers will use this background when displaying the image. Background is specified by r, g and b integers between 0 and (2⁁bitdepth)-1. For output color type 0 and 4 (gray, see section ) the green index is used as the gray level of the background. + + + + + + + +Use brute force, try 114 different filter/compression methods [11-124]. This option is very time-consuming and generally not worthwhile. You can restrict this option to certain filter types, compression levels, or strategies by following it with , , or . For example: + + &pngc; -brute -f 0 infile.png + + +Will try only methods that use filter type 0. + + + + + + + +Set the output image color type to type, one of [0, 2, 4, or 6] (see section ). Future versions of &pngc; will also allow color type 3, if there are 256 or fewer colors present in the input file. Color types 4 and 6 are padded with an opaque alpha channel if the input file does not have alpha information. You can use 0 or 4 to convert color to grayscale. Use 0 or 2 to delete an unwanted alpha channel. Default is to use same color type as the input file. + + + + + + + + +Specify a directory for all output files. All output files will have the same name as their respective input files. + + + + + + + +Double the images gamma. This is used for fixing gamma in PhotoShop 5.0c5.02 files. It has been claimed that the PS5 bug is actually more complex than that, in some unspecified way. + + + + + + + +Specify a new extension ext for all output files. + + + + + + + +Forces &pngc; to call exit() rather than return() when it is finished. It is unclear to this writer why this option exists. + + + + + + + + +Specify filter (see section ) to use with the method specified in the preceding or option. Valid filter types are [0-4] : use specified filter, [5]: use adaptive filtering. + + + + + + + +Fix otherwise fatal conditions such as bad CRCs. The CRC (Cyclic Redundancy Check) is present in every chunk and can alert the decoder of corrupt data. + + + + + + + +Write a new output file even if larger than input. Otherwise the input file will be copied to output if it is smaller than any generated file and no chunk additions, removals, or changes were requested. + + + + + + + +Value to insert in gAMA chunk, only if the input file has no gAMA chunk. To replace an existing gAMA chunk, use the option. Some decoders will use the gAMA chunk to more accurately display the image. gamma relates the output intensity to the input samples (input_sample = light_out^GAMMA). gamma can be any integer between 0 and 2^32 and is interpreted as GAMMA*100000. For example, if you wanted a GAMMA of 1/2.2, you would enter 45455 for gamma. + + + + + + + +Display help and legal notices. + + + + + + + + +Insert an (uncompressed) iTXt chunk. indicates whether chunk should be inserted before or after the IDAT chunk, (see Section ). + + + + + + + +keep named chunk chunk_name even if the PNG datastream becomes invalid. Currently only dSIG is recognized as an acceptable value. + + + + + + + +zlib compression level to use on the filtered IDAT chunk with the method specified by the preceding or option. zlib compression levels are integers between 0 and 9. 0 = no compression, 1 = fastest compression, and 9 = best compression. + + + + + + + +Make the file more compressible by performing a lossless, reversible, color transformation. The resulting file is a MNG format file, not a PNG, and should be given the .mng file extension. The option has no effect on grayscale or indexed-color PNG files. + + + + + + + +&pngc; method [0-200] to try (0 means try all of 1-10). Can be repeated as in . This can be useful if you run out of memory when &pngc; tries methods 2, 3, 5, 6, 8, 9, or 10 which use filtering and are memory intensive. Method 1, 4, and 7 use no filtering; methods 11 and up use specified filter, compression level, and strategy. + + + + + + + +Set the maximum idat size to be used when creating the compression buffer.[1 through 524288] + + + + + + + +write a new MNG, do not crush embedded PNGs. + + + + + + + +Do not do compression or write output file. This is useful in conjunction with the option to get info, or to test decode speed. + + + + + + + + +This option tells &pngc; to pause and wait for [enter] key whenever the screen fills. + + + + + + + +Truncates the PLTE. The PLTE chunk contains from 1 to 256 palette entries. Be sure not to truncate it to less than the greatest index present in IDAT. + + + + + + + +quiet, the opposite of verbose. + + + + + + + +Name of an ancillary chunk or optional PLTE to be removed. Be careful with +this. Please don't use this feature to remove transparency, gamma, copyright, +or other valuable information. To remove several different chunks, repeat: +. Known chunks (those in the PNG spec or extensions document) can be named with all lower-case letters, so is +equivalent to . But note: removes all forms of text +chunks; Exact case is required to remove unknown chunks. To do surgery with a +chain-saw, removes all known ancillary chunks except for tRNS, and + removes all but tRNS and gAMA. + + + + + + + +Force a specified gamma in the output file even if gAMA is present in the input. See the for more information. + + + + + + + +Write a pHYs chunk with a resolution of dpi. The pHYs chunk indicates the desired pixel size. + + + + + + + +Force writing of unknown chunks. If the input image has chunks that are not part of the PNG specification, they should not be discarded. + + + + + + + +Set value of rendering intent for sRGB chunk to n where n is between 0 and 3. The appropriate rendering intent depends on how the image will be used: + +0 - Perceptual: when good adaptation to the output device gamut at the expense of colorimetric accuracy is desired, example: photographs. +1 - Relative colorimetric: images requiring color appearance matching (relative to the output device white point), example: logos. +2: Saturation: preservation of saturation at the expense of hue and lightness is preferred, example: charts and graphs. +3: Absolute colorimetric: images requiring preservation of absolute colorimetry, example: proofs (previews of images destined for a different output device). + + + + + + + + +Insert a tEXt chunk. indicates whether chunk should be inserted before or after the IDAT chunk, (see Section ). + + + + + + + +Reset file modification time to newer time stamp. This is the default. + + + + + + + +Retain input file modification time stamp. The default is which is the opposite of this option. + + + + + + + +Insert a tRNS (transparency) chunk, if no tRNS chunk found in file. You must give all five parameters regardless of the color type, scaled to the output bit depth. See the PNG documentation for details. + + + + + + + +Insert a tRNS (transparency) chunk, if no tRNS chunk found in file. See the PNG documentation for details. + + + + + + + +Display more detailed information. Repeat the option (use "-v -v") for even more. + + + + + + + +Specify size in kbytes (or bytes in the case of 512) of the sliding +compression window where size is one of [32, 16, 8, 4, 2, 1, or 512]. It's best to +use the default (32) unless you run out of memory. The program will use a +smaller window anyway when the uncompressed file is smaller than 16k. + + + + + + + +Specify the zlib compression strategy [0, 1, or 2] to be used on the filtered IDAT chunk for the method of the preceding . The zlib strategy parameter tunes the compression algorithm and is one of: + +0 : default, most compression is aimed towards string matching +1 : some string matching, some Huffman coding +2 : use only Huffman coding + + + + + + + + + +Insert a zTXt chunk. indicates whether chunk should be inserted before or after the IDAT chunk, (see Section ). + + + + + + + +zTXt chunk to insert (see -text). + + + + + + +Color Types + +The PNG specification provides for five color types. The color type determines how the IDAT chunk will be interpreted by the decoder. Choosing a color type appropriate for the color information in an image can in principle reduce the size. However, certain combinations of and require color counting which is currently disabled. In such cases no reduction will take place. Following are the PNG color types followed by their supported bit depths (Note &pngc; does not support changing a file to color type 3 from another color type.): + +0 : grayscale without alpha channel (1,2,4,8,16) +2 : true color without alpha channel (8,16) +3 : indexed color (1,2,4,8) +4 : grayscale with alpha channel (8,16) +6 : true color with alpha channel (8,16) + + +An alpha channel represents transparency on a per pixel basis. An alpha value of zero is completely transparent. An alpha channel of 2^bitdepth-1 is completely opaque. + + + +Filter Types + +The IDAT chunk can optionally be filtered before compression. These filters can make the IDAT chunk more compressible without losing any data and result in a smaller PNG file. These filters are applied to the bytes of the IDAT chunk, not the pixels. Following is a brief description of the filters, see the PNG specification for details: + + +0 : no filter +1 : 'sub' transmits the difference between each byte and the value of the corresponding byte of the prior pixel. +2 : 'up' transmits the difference between each byte and the value of the corresponding byte of the pixel above this pixel +3 : 'average' transmits the difference between each byte and the average of the bytes described in filters 1 and 2 +4 : 'paeth' computes a simple linear function of the corresponding byte in three neighboring pixels (paeth_predictor = left + above - upper left), then transmits the difference between the byte in question and the neighboring byte closest to the value of paeth_predictor. + + + +Text Chunks +Textual information pertaining to an image can be conveyed with the tEXt, iTXt and zTXt chunks. All text chunks consist of a keyword followed by a string. The following keywords are defined in the PNG specification: (you may invent keywords for other purposes): + +Title: Short title or caption for image +Author: Name of image's creator +Description: Longer description of image +Copyright: Copyright notice +Creation Time: Time of original image creation +Software: Software used to create the image +Disclaimer: Legal disclaimer +Warning: Warning of nature of content +Source: Device used to create the image +Comment: Miscellaneous comment. + +A tEXt chunk stores text in the ISO/IEC 8859-1 (Latin-1) character set. zTXt chunks also use the Latin-1 character set, but the text is compressed. This can be useful for large text chunks. iTXt chunks consist of text in the UTF-8 of the Unicode character set. + +keyword must be at least 1 character and less than 80 characters. text must be less than 2048 characters when using &pngc; For now, you can only add ten tEXt, iTXt, or zTXt chunks per &pngc; run. + + + + SEE ALSO + png(5), libpng(3), zlib(3). + + + AUTHOR + + This manual page was written by &dhusername; &dhemail; for + the &debian; system (but may be used by others). Much of the + information was gleaned from "PNG (Portable Network Graphics) Specification, Version 1.2" + + +
+ + diff --git a/SPECS/pngcrush.spec b/SPECS/pngcrush.spec new file mode 100644 index 0000000..f44a82c --- /dev/null +++ b/SPECS/pngcrush.spec @@ -0,0 +1,188 @@ +%global _hardened_build 1 + +Summary: Optimizer for PNG (Portable Network Graphics) files +Name: pngcrush +Version: 1.8.13 +Release: 9%{?dist} +License: zlib +URL: http://pmt.sourceforge.net/%{name}/ +Source0: http://downloads.sourceforge.net/pmt/%{name}-%{version}-nolib.tar.xz +# from Debian sid. +Source1: %{name}.sgml +BuildRequires: docbook-utils +BuildRequires: gcc +BuildRequires: libpng-devel +BuildRequires: pkgconfig +BuildRequires: zlib-devel + +%description +pngcrush is a commandline optimizer for PNG (Portable Network Graphics) files. +Its main purpose is to reduce the size of the PNG IDAT datastream by trying +various compression levels and PNG filter methods. It also can be used to +remove unwanted ancillary chunks, or to add certain chunks including gAMA, +tRNS, iCCP, and textual chunks. + +%prep +%setup -q -n %{name}-%{version}-nolib +cp %{SOURCE1} . + +%build +rm -f z*.h crc32.h deflate.h inf*.h trees.h png*.h # force using system headers +pngflags=$(pkg-config --cflags --libs libpng) +gcc %{optflags} $pngflags -lz -o %{name} %{name}.c +docbook2man %{name}.sgml + +%install +%{__install} -D -m0755 %{name} %{buildroot}%{_bindir}/%{name} +%{__install} -D -m0644 %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1 + +%files +%doc ChangeLog.html +%license LICENSE +%{_bindir}/%{name} +%doc %{_mandir}/man1/%{name}.1.gz + +%changelog +* Fri Jul 23 2021 Fedora Release Engineering - 1.8.13-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Wed Jan 27 2021 Fedora Release Engineering - 1.8.13-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Jul 28 2020 Fedora Release Engineering - 1.8.13-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Thu Jan 30 2020 Fedora Release Engineering - 1.8.13-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Jul 26 2019 Fedora Release Engineering - 1.8.13-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sat Feb 02 2019 Fedora Release Engineering - 1.8.13-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Jul 13 2018 Fedora Release Engineering - 1.8.13-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Thu Mar 08 2018 Josef Ridky - 1.8.13-2 +- remove Group tag + +* Tue Feb 20 2018 Nils Philippsen - 1.8.13-1 +- version 1.8.13 +- ship license +- remove some old packaging cruft +- require gcc for building + +* Fri Feb 09 2018 Fedora Release Engineering - 1.8.11-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Sun Jan 21 2018 François Cami - 1.8.11-1 +- New upstream release. + +* Thu Aug 03 2017 Fedora Release Engineering - 1.8.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 1.8.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 1.8.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Mon Mar 28 2016 François Cami - 1.8.0-1 +- New upstream release. + +* Thu Feb 04 2016 Fedora Release Engineering - 1.7.88-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Mon Dec 14 2015 François Cami - 1.7.88-1 +- New upstream release. + +* Thu Jun 18 2015 Fedora Release Engineering - 1.7.82-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Mon Jan 05 2015 François Cami - 1.7.82-1 +- New upstream release. + +* Mon Nov 24 2014 François Cami - 1.7.81-1 +- New upstream release. + +* Thu Oct 23 2014 François Cami - 1.7.78-1 +- New upstream release. +- Add man page from Debian sid (1.7.65-0.1). + +* Sun Aug 17 2014 Fedora Release Engineering - 1.7.70-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 1.7.70-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sun Dec 29 2013 François Cami - 1.7.70-1 +- New upstream release. + +* Mon Dec 16 2013 François Cami - 1.7.69-2 +- Fix changelog. + +* Mon Dec 16 2013 François Cami - 1.7.69-1 +- New upstream release. + +* Tue Jul 30 2013 François Cami - 1.7.66-1 +- New upstream release. + +* Tue Jul 30 2013 François Cami - 1.7.59-3 +- Fix obvious typos in description. + +* Sun Jun 2 2013 François Cami - 1.7.59-2 +- Switch to the smaller -nolib archive. + +* Fri May 31 2013 François Cami - 1.7.59-1 +- New upstream release. +- Use more macros. +- Switch to hardened build. + +* Thu Feb 14 2013 Fedora Release Engineering - 1.7.43-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Sun Jan 13 2013 François Cami - 1.7.43-1 +- New upstream release. + +* Tue Jul 31 2012 Jon Ciesla - 1.7.35-1 +- Update to latest to fix FTBFS. + +* Sat Jul 21 2012 Fedora Release Engineering - 1.6.10-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Sat Jan 14 2012 Fedora Release Engineering - 1.6.10-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Dec 06 2011 Adam Jackson - 1.6.10-8 +- Rebuild for new libpng + +* Wed Feb 09 2011 Fedora Release Engineering - 1.6.10-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Feb 16 2010 Gerd Hoffmann - 1.6.10-6 +- Fix FTBFS (#565047). + +* Sun Jul 26 2009 Fedora Release Engineering - 1.6.10-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Thu Feb 26 2009 Fedora Release Engineering - 1.6.10-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Mon Nov 3 2008 - Gerd Hoffmann - 1.6.10-3.fc9 +- remove all unneeded (zlib/libpng copy) header files. +- fix Source: URL. +- get cflags and libs from pkg-config. + +* Fri Oct 31 2008 - Gerd Hoffmann - 1.6.10-2.fc9 +- use $RPM_OPT_FLAGS. +- use systems zlib and libpng. + +* Wed Oct 15 2008 - Gerd Hoffmann - 1.6.10-1.fc9 +- update to 1.6.10. +- add dist tag to release. +- fix license. +- fix rpmlint warnings. + +* Mon Jul 07 2008 - Patrick Steiner - 1.6.7-1 +- Initial package.