Mageia Bugzilla – Attachment 9429 Details for
Bug 20057
libtiff new security issues CVE-2016-1009[2-5], CVE-2017-5225, CVE-2017-5849 and more
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
Functionality tests using libtiff utilities
tifftests (text/plain), 5.66 KB, created by
Len Lawrence
on 2017-06-19 16:51:33 CEST
(
hide
)
Description:
Functionality tests using libtiff utilities
Filename:
MIME Type:
Creator:
Len Lawrence
Created:
2017-06-19 16:51:33 CEST
Size:
5.66 KB
patch
obsolete
>$ pnmtotiff Ikapati.pgm -output test.pnm >$ display test.pnm ># Perfect image of Ikapati region on Ceres > >$ pnmtotiff mandrill.pgm -output test.pnm ># Image of a mandrill > >$ pnmtotiff Ikapati.pgm -output test.pnm >$ display test.pnm ># Image of a mandrill ># Right-click on image and select Next ># Image of Ikapati region, frame 2 ># Some of these utilities treat -output file as a stream and append frames. > >$ pnmtotiffcmyk -negative mandrill.pgm > cmyk.pnm ># Expected a negative image of mandrill but saw a copy. ># No better with a coloured image. >$ tifftopnm lena_color.tiff > lena.pnm >tifftopnm: writing PPM file >$ display lena.pnm ># As good as the original >$ pnmtotiffcmyk -gamma 2.4 lena.pnm > cmyk.pnm ># This completely skewed the colours, making it look like a negative, ># probably what is expected. > >$ tiffgt SantaMaria.tif ># Displays a greyscale image with coloured annotations. > >$ tiffcp bridge.tif newbridge.tif ># They look the same but have slightly different sizes. >$ ls -l *bridge* >-rw-r--r-- 1 lcl lcl 262393 Nov 16 2016 bridge.tif >-rw-r--r-- 1 lcl lcl 262649 Jun 19 11:50 newbridge.tif > >$ ppm2tiff lena.pnm lena_from_ppm.tif ># Used tiffgt to confirm the copy. > >$ PTtiff2psd -f *.tiff ># force option used because files do not all have the same width. ># The utility tried to build a Photoshop document but had to abort. >$ PTtiff2psd lena*.ti* >PTtiff2psd Version 2.9.19 , based on code by Helmut Dersch, rewritten by Daniel M German and Jim Watters >Image 0 and 2 do not have the same colour depth >TIFFs are not compatible. Use -f to force processing >$ PTtiff2psd -f lena*.ti* >PTtiff2psd Version 2.9.19 , based on code by Helmut Dersch, rewritten by Daniel M German and Jim Watters >Creating output file merged.psd >Converting TIFF to PSD 66%We only support 3 or 4 samples per pixel >Could not read TIFF image No &d >Error while creating PSD file >$ ls -l merged.psd >-rw-r--r-- 1 lcl lcl 2621856 Jun 19 11:32 merged.psd >No way to look at this without Windows or PhotoShop. > >$ PTtiffdump lena.tif lena_from_ppm.tif > filedump >[lcl@vega images]$ cat filedump >PTuncrop Version 2.9.19 , by Daniel M German >We only support 3 or 4 samples per pixel >Unable to open input file >$ PTtiffdump macbeth_rgba.tif macbeth_rgb.tif >PTuncrop Version 2.9.19 , by Daniel M German >Comparing 850 1159 pixels > 0, 0,r, 15 ff, B > 0, 0,g, 21 ff, B > 0, 0,b, 20 ff, B > 0, 1,g, 21 ff, B > 0, 1,b, 1b 14, A > 0, 2,b, 1b ff, B >Compared 985150 pixels 1 above 5 below >Percent of different values 0.000 > >Skipped raw2tiff. No raw data file. > >$ tiff2bw macbeth_rgb.tif macbeth_bw.tif >$ tiffgt macbeth_bw.tif >libGL error: No matching fbConfigs or visuals found >libGL error: failed to load driver: swrast >libGL error: No matching fbConfigs or visuals found >libGL error: failed to load driver: i965 >libGL error: No matching fbConfigs or visuals found >libGL error: failed to load driver: swrast ># These errors can be ignored - I see them routinely. ># The image looked fine - greyscale conversion. > >$ tiff2pdf boats.tif > boats.pdf >$ xpdf boats.pdf ># Looks perfect. > >$ tiff2ps lena.tif > lena.ps >$ gs lena.ps ># Displayed the greyscale image with bottom lefthand corner at [0,0] on a ># Postscript page. > >$ tiffcrop -E top -U px -m 100,100,100,100 SantaMaria.tif cropped.tif >_TIFFVGetField: cropped.tif: Invalid tag "BadFaxLines" (not supported by codec). >_TIFFVGetField: cropped.tif: Invalid tag "BadFaxLines" (not supported by codec). ># The cropped image was a copy of the original with a 100-pixel-wide border removed. ># This utility can also be used to flip or rotate the cropped image. > >$ tiffdither airfield.tif dithered.tif >The two-level dither pattern was quite evident in the resulting image. > >$ tiffdump SantaMaria.tif > dumpfile >$ cat dumpfile >SantaMaria.tif: >Magic: 0x4949 <little-endian> Version: 0x2a <ClassicTIFF> >Directory 0: offset 1971016 (0x1e1348) next 0 (0) >ImageWidth (256) SHORT (3) 1<1638> >ImageLength (257) SHORT (3) 1<1410> >........................................ >ResolutionUnit (296) SHORT (3) 1<2> >PageNumber (297) SHORT (3) 2<0 1> >Predictor (317) SHORT (3) 1<2> >Whitepoint (318) RATIONAL (5) 2<0.3127 0.329> >PrimaryChromaticities (319) RATIONAL (5) 6<0.64 0.33 0.3 0.6 0.15 0.06> >BadFaxLines (326) LONG (4) 1<2707030018> > >$ tiffinfo einstein.tif >TIFF Directory at offset 0x10008 (65544) > Image Width: 256 Image Length: 256 > Resolution: 1200, 1200 pixels/inch > Bits/Sample: 8 > Compression Scheme: None > Photometric Interpretation: min-is-black > Orientation: row 0 top, col 0 lhs > Samples/Pixel: 1 > Rows/Strip: 256 > Planar Configuration: single image plane > ImageDescription: MatLab PGMWRITE file, saved 27-Aug-96 > >$ tiffmedian example2.tiff median.tif >This quantizes the colour range within an image. >Colour averaging evident in the resulting image. > ># tiffset may be used to directly alter the properties of a tiff image in situ. ># The -s parameter specifies the "tag" (attribute number). Tag values can be ># examined via the tiffdump command. ># In this experiment the Y and X resolutions were changed from the original ># 495.063 to 300 and the image looked OK. The tags were set to the new values. >$ tiffset -s 283 300.0 craters.tif >_TIFFVGetField: craters.tif: Invalid tag "BadFaxLines" (not supported by codec). >_TIFFVGetField: craters.tif: Invalid tag "BadFaxLines" (not supported by codec). >$ tiffset -s 282 300.0 craters.tif >_TIFFVGetField: craters.tif: Invalid tag "BadFaxLines" (not supported by codec). >_TIFFVGetField: craters.tif: Invalid tag "BadFaxLines" (not supported by codec). ># Those error messages are also a familiar sight and can probably be ignored. > >$ tiffsplit greycombo.tif ># This split the original image into {xaaa,xaab,xaac,xaad}.tif each of which ># were faithful copies of the frames stacked in the source image. >
$ pnmtotiff Ikapati.pgm -output test.pnm $ display test.pnm # Perfect image of Ikapati region on Ceres $ pnmtotiff mandrill.pgm -output test.pnm # Image of a mandrill $ pnmtotiff Ikapati.pgm -output test.pnm $ display test.pnm # Image of a mandrill # Right-click on image and select Next # Image of Ikapati region, frame 2 # Some of these utilities treat -output file as a stream and append frames. $ pnmtotiffcmyk -negative mandrill.pgm > cmyk.pnm # Expected a negative image of mandrill but saw a copy. # No better with a coloured image. $ tifftopnm lena_color.tiff > lena.pnm tifftopnm: writing PPM file $ display lena.pnm # As good as the original $ pnmtotiffcmyk -gamma 2.4 lena.pnm > cmyk.pnm # This completely skewed the colours, making it look like a negative, # probably what is expected. $ tiffgt SantaMaria.tif # Displays a greyscale image with coloured annotations. $ tiffcp bridge.tif newbridge.tif # They look the same but have slightly different sizes. $ ls -l *bridge* -rw-r--r-- 1 lcl lcl 262393 Nov 16 2016 bridge.tif -rw-r--r-- 1 lcl lcl 262649 Jun 19 11:50 newbridge.tif $ ppm2tiff lena.pnm lena_from_ppm.tif # Used tiffgt to confirm the copy. $ PTtiff2psd -f *.tiff # force option used because files do not all have the same width. # The utility tried to build a Photoshop document but had to abort. $ PTtiff2psd lena*.ti* PTtiff2psd Version 2.9.19 , based on code by Helmut Dersch, rewritten by Daniel M German and Jim Watters Image 0 and 2 do not have the same colour depth TIFFs are not compatible. Use -f to force processing $ PTtiff2psd -f lena*.ti* PTtiff2psd Version 2.9.19 , based on code by Helmut Dersch, rewritten by Daniel M German and Jim Watters Creating output file merged.psd Converting TIFF to PSD 66%We only support 3 or 4 samples per pixel Could not read TIFF image No &d Error while creating PSD file $ ls -l merged.psd -rw-r--r-- 1 lcl lcl 2621856 Jun 19 11:32 merged.psd No way to look at this without Windows or PhotoShop. $ PTtiffdump lena.tif lena_from_ppm.tif > filedump [lcl@vega images]$ cat filedump PTuncrop Version 2.9.19 , by Daniel M German We only support 3 or 4 samples per pixel Unable to open input file $ PTtiffdump macbeth_rgba.tif macbeth_rgb.tif PTuncrop Version 2.9.19 , by Daniel M German Comparing 850 1159 pixels 0, 0,r, 15 ff, B 0, 0,g, 21 ff, B 0, 0,b, 20 ff, B 0, 1,g, 21 ff, B 0, 1,b, 1b 14, A 0, 2,b, 1b ff, B Compared 985150 pixels 1 above 5 below Percent of different values 0.000 Skipped raw2tiff. No raw data file. $ tiff2bw macbeth_rgb.tif macbeth_bw.tif $ tiffgt macbeth_bw.tif libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: i965 libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast # These errors can be ignored - I see them routinely. # The image looked fine - greyscale conversion. $ tiff2pdf boats.tif > boats.pdf $ xpdf boats.pdf # Looks perfect. $ tiff2ps lena.tif > lena.ps $ gs lena.ps # Displayed the greyscale image with bottom lefthand corner at [0,0] on a # Postscript page. $ tiffcrop -E top -U px -m 100,100,100,100 SantaMaria.tif cropped.tif _TIFFVGetField: cropped.tif: Invalid tag "BadFaxLines" (not supported by codec). _TIFFVGetField: cropped.tif: Invalid tag "BadFaxLines" (not supported by codec). # The cropped image was a copy of the original with a 100-pixel-wide border removed. # This utility can also be used to flip or rotate the cropped image. $ tiffdither airfield.tif dithered.tif The two-level dither pattern was quite evident in the resulting image. $ tiffdump SantaMaria.tif > dumpfile $ cat dumpfile SantaMaria.tif: Magic: 0x4949 <little-endian> Version: 0x2a <ClassicTIFF> Directory 0: offset 1971016 (0x1e1348) next 0 (0) ImageWidth (256) SHORT (3) 1<1638> ImageLength (257) SHORT (3) 1<1410> ........................................ ResolutionUnit (296) SHORT (3) 1<2> PageNumber (297) SHORT (3) 2<0 1> Predictor (317) SHORT (3) 1<2> Whitepoint (318) RATIONAL (5) 2<0.3127 0.329> PrimaryChromaticities (319) RATIONAL (5) 6<0.64 0.33 0.3 0.6 0.15 0.06> BadFaxLines (326) LONG (4) 1<2707030018> $ tiffinfo einstein.tif TIFF Directory at offset 0x10008 (65544) Image Width: 256 Image Length: 256 Resolution: 1200, 1200 pixels/inch Bits/Sample: 8 Compression Scheme: None Photometric Interpretation: min-is-black Orientation: row 0 top, col 0 lhs Samples/Pixel: 1 Rows/Strip: 256 Planar Configuration: single image plane ImageDescription: MatLab PGMWRITE file, saved 27-Aug-96 $ tiffmedian example2.tiff median.tif This quantizes the colour range within an image. Colour averaging evident in the resulting image. # tiffset may be used to directly alter the properties of a tiff image in situ. # The -s parameter specifies the "tag" (attribute number). Tag values can be # examined via the tiffdump command. # In this experiment the Y and X resolutions were changed from the original # 495.063 to 300 and the image looked OK. The tags were set to the new values. $ tiffset -s 283 300.0 craters.tif _TIFFVGetField: craters.tif: Invalid tag "BadFaxLines" (not supported by codec). _TIFFVGetField: craters.tif: Invalid tag "BadFaxLines" (not supported by codec). $ tiffset -s 282 300.0 craters.tif _TIFFVGetField: craters.tif: Invalid tag "BadFaxLines" (not supported by codec). _TIFFVGetField: craters.tif: Invalid tag "BadFaxLines" (not supported by codec). # Those error messages are also a familiar sight and can probably be ignored. $ tiffsplit greycombo.tif # This split the original image into {xaaa,xaab,xaac,xaad}.tif each of which # were faithful copies of the frames stacked in the source image.
View Attachment As Raw
Actions:
View
Attachments on
bug 20057
:
9422
|
9423
|
9424
|
9425
|
9427
| 9429