change PNG endian without a pipe (need -set endian LSB/MSB)

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
thomas12
Posts: 24
Joined: 2013-05-01T07:56:16-07:00
Authentication code: 6789

Re: change PNG endian without a pipe (need -set endian LSB/M

Post by thomas12 »

I found the new switch in the current public version of IM 6
SVN revision 14676 (2014-01-29 6.8.8-4)
but I can't find the right syntax

first check binary IM_MOD_RL_png_.dll for the new option png:swap-bytes:

Code: Select all

> strings.exe ImageMagick-6.8.8-Q16\modules\coders\IM_MOD_RL_png_.dll | grep swap
png:swap-bytes
png_set_swap
but this samples doesn't switch the bytes:

Code: Select all

ImageMagick-6.8.8-Q16\convert.exe -define png:swap-bytes t1.png -auto-level test.jpg
ImageMagick-6.8.8-Q16\convert.exe -define png:swap-bytes=on t1.png -auto-level test.jpg
ImageMagick-6.8.8-Q16\convert.exe -define png:swap-bytes=on png:t1.png -auto-level test.jpg
etc.
check version

Code: Select all

> convert.exe -version
Version: ImageMagick 6.8.8-3 Q16 x64 2014-01-19 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo freetype jbig jng jp2 jpeg lcms lqr pangocairo png ps rsvg tiff webp xml zlib
thanks for help
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: change PNG endian without a pipe (need -set endian LSB/M

Post by glennrp »

There appears to be a sign error in the test for png:swap-bytes. The first of your example commandlines is the correct one but they should all work.

edit: Fix is checked in to SVN for ImageMagick-6.8.8-5. The problem was that coders/png.c used GetNextImageProperty() instead of GetImageOption().
Post Reply