Mageia Bugzilla – Attachment 9518 Details for
Bug 19668
graphicsmagick several (possible) new security issues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
A selection of utility tests for GraphicsMagick
utilities.txt (text/plain), 5.69 KB, created by
Len Lawrence
on 2017-07-25 18:46:32 CEST
(
hide
)
Description:
A selection of utility tests for GraphicsMagick
Filename:
MIME Type:
Creator:
Len Lawrence
Created:
2017-07-25 18:46:32 CEST
Size:
5.69 KB
patch
obsolete
>$ gm help >provides a list of valid commands, for which further information is available using 'gm help <command>. > >Tried a selection of these, the simpler ones: >----------------------------------------------------------------------------- >Used vlc to generate a series of PNG frames from a 36 second Youtube mp4 clip. >$ gm animate AlainaHuffman/Johansen* > >This displayed a 9 second movie of the original subject in a continuous loop. >vlc had been set to save every fourth frame. > >----------------------------------------------------------------------------- >GraphicsMagick commands can be run from a batch file. e.g. >$ gm batch -feedback on -pass ' ' -fail o-oh batchfile >$ cat batchfile >animate AlainaHuffman/* >display AlainaHuffman/Johansen00809.png >display /data/images/astro/vela_skyfactory.jpg >display AlainaHuffman/Johansen00709.png > >Useful for a presentation maybe. Also for running the current utility tests more than once. The feedback and prompt options don't look very useful but they were tested anyway. With feedback on the animation passed OK but the image displays each raised FAIL even though there was no error. That looks like a minor bug - could be a regression but it is not worth holding up the parade for it. > >----------------------------------------------------------------------------- >$ gm compare -file imagediff Johansen00229.png Johansen00233.png >$ gm display imagediff >This showed an image recognizably similar to the two frames. Options can be passed to refine the comparison. > >----------------------------------------------------------------------------- >composite and conjure require more than a passing glance so let's carry on. > >----------------------------------------------------------------------------- >convert has a multitude of options >$ gm convert -average Johansen*.png average.png >This looked as expected with a blurred figure against a sharp background. > >$ gm convert TatianaMaslany.jpg OrphanBlack.png >gm convert: profile matches sRGB but writing iCCP instead (OrphanBlack.png) [No such file or directory]. > >$ gm display OrphanBlack.png >gm display: iCCP: known incorrect sRGB profile (OrphanBlack.png). >Despite the warnings the displayed image is perfect. > >$ gm convert -border 10 -bordercolor thistle JessicaAlba.jpg boxedin.jpg >boxedin.jpg has a 10 pixel wide border. > >$ gm identify boxedin.jpg >boxedin.jpg JPEG 620x468+0+0 DirectClass 8-bit 37.9Ki 0.000u 0m:0.000002s >$ gm convert -crop 600x448+10+10 boxedin.jpg borderless.jpg >borderless.jpg looks identical to JessicaAlba.jpg. > >$ gm identify GlenShiel_5.jpg >GlenShiel_5.jpg JPEG 3648x2736+0+0 DirectClass 8-bit 4.6Mi 0.000u 0m:0.000002s >$ gm convert -resize 40%x40% GlenShiel_5.jpg GlenShiel.jpg >$ gm identify GlenShiel.jpg >GlenShiel.jpg JPEG 1459x1094+0+0 DirectClass 8-bit 248.4Ki 0.000u 0m:0.000002s > >$ gm convert -charcoal 2 GlenShiel.jpg Glenview.png >Returns a greyscale artistic image and converts the image format. >$ gm convert -charcoal 8 GlenShiel.jpg Glenview.gif >The broader strokes are more effective. > >$ gm convert -rotate 90 GlenShiel_2.jpg ninety.jpg >Image rotated 90° clockwise. > >$ gm convert -emboss 4 GlenShiel_4.jpg embossed.jpg >That was effective and with a larger radius the effect was more pronounced. >$ gm convert -emboss 8 JessicaAlba.jpg embossed.jpg > >$ gm convert -flip GlenShiel_2.jpg flipped.jpg >flipped.jpg is an upside-down version of the original. > >$ gm convert -flop GlenShiel_2.jpg flopped.jpg >flopped.jpg is the original switched from right to left. > >$ gm convert -magnify JessicaAlba.jpg doubled.jpg >Double-size image generated by interpolation. > >$ gm convert -minify GlenShiel_1.jpg halved.jpg >Half-size image produced. > >$ gm convert -paint 4 LochLubnaig_2.jpg oilpaint.jpg >This produces an artistic effect. > >$ gm convert -shade 30 TatianaMaslany.jpg light30.jpg >Greyscale image with shadows from light source at 30° on the right, producing an embossed effect. >$ gm convert -shade 90 TatianaMaslany.jpg light90.jpg >Similar effect with the light overhead. > >$ gm convert -monochrome LochLubnaig_10.jpg greylake.jpg >Image is strictly monochrome with black and white dithering. > >----------------------------------------------------------------------------- >mogrify has similar functionality to convert but transforms the image in place. > >$ gm identify GlenShiel_6.jpg >GlenShiel_6.jpg JPEG 4000x3000+0+0 DirectClass 8-bit 4.6Mi 0.000u 0m:0.000002s >$ gm mogrify -resize 50% GlenShiel_6.jpg >$ gm identify GlenShiel_6.jpg >GlenShiel_6.jpg JPEG 2000x1500+0+0 DirectClass 8-bit 374.1Ki 0.000u 0m:0.000004s > >The loss of image detail on shrinking can be offset by specifying the quality: >$ gm identify GlenShiel_1.jpg >GlenShiel_1.jpg JPEG 3648x2736+0+0 DirectClass 8-bit 1.6Mi 0.000u 0m:0.000002s >$ gm mogrify -resize 50% -quality 100 GlenShiel_1.jpg >$ gm identify GlenShiel_1.jpg >GlenShiel_1.jpg JPEG 1824x1368+0+0 DirectClass 8-bit 2.6Mi 0.000u 0m:0.000002s > >----------------------------------------------------------------------------- >Creating a montage > >Used a batch file to convert a set of 10 files to thumbnails; >typical entry: >convert -thumbnail 8% LochLubnaig_1.jpg loch_1.png >$ gm batch thumbnailer >$ gm montage -adjoin loch_*.png montage.png > >This generated a container image with the thumbnails arranged 2x5 (by default). > >----------------------------------------------------------------------------- >The following returns far more information than expected, including configuration and build information: >$ gm version >GraphicsMagick 1.3.26 2017-07-04 Q8 http://www.GraphicsMagick.org/ >Copyright (C) 2002-2017 GraphicsMagick Group. >Additional copyrights and licenses apply to this software. >See http://www.GraphicsMagick.org/www/Copyright.html for details. > >Feature Support: > Native Thread Safe yes > Large Files (> 32 bit) yes >............................ ><lots more> > > >
$ gm help provides a list of valid commands, for which further information is available using 'gm help <command>. Tried a selection of these, the simpler ones: ----------------------------------------------------------------------------- Used vlc to generate a series of PNG frames from a 36 second Youtube mp4 clip. $ gm animate AlainaHuffman/Johansen* This displayed a 9 second movie of the original subject in a continuous loop. vlc had been set to save every fourth frame. ----------------------------------------------------------------------------- GraphicsMagick commands can be run from a batch file. e.g. $ gm batch -feedback on -pass ' ' -fail o-oh batchfile $ cat batchfile animate AlainaHuffman/* display AlainaHuffman/Johansen00809.png display /data/images/astro/vela_skyfactory.jpg display AlainaHuffman/Johansen00709.png Useful for a presentation maybe. Also for running the current utility tests more than once. The feedback and prompt options don't look very useful but they were tested anyway. With feedback on the animation passed OK but the image displays each raised FAIL even though there was no error. That looks like a minor bug - could be a regression but it is not worth holding up the parade for it. ----------------------------------------------------------------------------- $ gm compare -file imagediff Johansen00229.png Johansen00233.png $ gm display imagediff This showed an image recognizably similar to the two frames. Options can be passed to refine the comparison. ----------------------------------------------------------------------------- composite and conjure require more than a passing glance so let's carry on. ----------------------------------------------------------------------------- convert has a multitude of options $ gm convert -average Johansen*.png average.png This looked as expected with a blurred figure against a sharp background. $ gm convert TatianaMaslany.jpg OrphanBlack.png gm convert: profile matches sRGB but writing iCCP instead (OrphanBlack.png) [No such file or directory]. $ gm display OrphanBlack.png gm display: iCCP: known incorrect sRGB profile (OrphanBlack.png). Despite the warnings the displayed image is perfect. $ gm convert -border 10 -bordercolor thistle JessicaAlba.jpg boxedin.jpg boxedin.jpg has a 10 pixel wide border. $ gm identify boxedin.jpg boxedin.jpg JPEG 620x468+0+0 DirectClass 8-bit 37.9Ki 0.000u 0m:0.000002s $ gm convert -crop 600x448+10+10 boxedin.jpg borderless.jpg borderless.jpg looks identical to JessicaAlba.jpg. $ gm identify GlenShiel_5.jpg GlenShiel_5.jpg JPEG 3648x2736+0+0 DirectClass 8-bit 4.6Mi 0.000u 0m:0.000002s $ gm convert -resize 40%x40% GlenShiel_5.jpg GlenShiel.jpg $ gm identify GlenShiel.jpg GlenShiel.jpg JPEG 1459x1094+0+0 DirectClass 8-bit 248.4Ki 0.000u 0m:0.000002s $ gm convert -charcoal 2 GlenShiel.jpg Glenview.png Returns a greyscale artistic image and converts the image format. $ gm convert -charcoal 8 GlenShiel.jpg Glenview.gif The broader strokes are more effective. $ gm convert -rotate 90 GlenShiel_2.jpg ninety.jpg Image rotated 90° clockwise. $ gm convert -emboss 4 GlenShiel_4.jpg embossed.jpg That was effective and with a larger radius the effect was more pronounced. $ gm convert -emboss 8 JessicaAlba.jpg embossed.jpg $ gm convert -flip GlenShiel_2.jpg flipped.jpg flipped.jpg is an upside-down version of the original. $ gm convert -flop GlenShiel_2.jpg flopped.jpg flopped.jpg is the original switched from right to left. $ gm convert -magnify JessicaAlba.jpg doubled.jpg Double-size image generated by interpolation. $ gm convert -minify GlenShiel_1.jpg halved.jpg Half-size image produced. $ gm convert -paint 4 LochLubnaig_2.jpg oilpaint.jpg This produces an artistic effect. $ gm convert -shade 30 TatianaMaslany.jpg light30.jpg Greyscale image with shadows from light source at 30° on the right, producing an embossed effect. $ gm convert -shade 90 TatianaMaslany.jpg light90.jpg Similar effect with the light overhead. $ gm convert -monochrome LochLubnaig_10.jpg greylake.jpg Image is strictly monochrome with black and white dithering. ----------------------------------------------------------------------------- mogrify has similar functionality to convert but transforms the image in place. $ gm identify GlenShiel_6.jpg GlenShiel_6.jpg JPEG 4000x3000+0+0 DirectClass 8-bit 4.6Mi 0.000u 0m:0.000002s $ gm mogrify -resize 50% GlenShiel_6.jpg $ gm identify GlenShiel_6.jpg GlenShiel_6.jpg JPEG 2000x1500+0+0 DirectClass 8-bit 374.1Ki 0.000u 0m:0.000004s The loss of image detail on shrinking can be offset by specifying the quality: $ gm identify GlenShiel_1.jpg GlenShiel_1.jpg JPEG 3648x2736+0+0 DirectClass 8-bit 1.6Mi 0.000u 0m:0.000002s $ gm mogrify -resize 50% -quality 100 GlenShiel_1.jpg $ gm identify GlenShiel_1.jpg GlenShiel_1.jpg JPEG 1824x1368+0+0 DirectClass 8-bit 2.6Mi 0.000u 0m:0.000002s ----------------------------------------------------------------------------- Creating a montage Used a batch file to convert a set of 10 files to thumbnails; typical entry: convert -thumbnail 8% LochLubnaig_1.jpg loch_1.png $ gm batch thumbnailer $ gm montage -adjoin loch_*.png montage.png This generated a container image with the thumbnails arranged 2x5 (by default). ----------------------------------------------------------------------------- The following returns far more information than expected, including configuration and build information: $ gm version GraphicsMagick 1.3.26 2017-07-04 Q8 http://www.GraphicsMagick.org/ Copyright (C) 2002-2017 GraphicsMagick Group. Additional copyrights and licenses apply to this software. See http://www.GraphicsMagick.org/www/Copyright.html for details. Feature Support: Native Thread Safe yes Large Files (> 32 bit) yes ............................ <lots more>
View Attachment As Raw
Actions:
View
Attachments on
bug 19668
: 9518 |
9526
|
9527
|
9528