TIFF image conversion problem (inverse)

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
xhenxhe

TIFF image conversion problem (inverse)

Post by xhenxhe »

I have group 4 Tiff file (attached) I run the following code to convert it to pdf

Code: Select all

$im = new Imagick('barcodes.tif');
$im->setFormat('PDF');
$im->writeImage('barcodes.pdf');
The result is an inverse of the original file. Has anyone experienced this. Is there a workaround?

I can change the compression to jpeg or something, but it makes the pdf file much larger.
Attachments
This is a screen shot of the pdf file
This is a screen shot of the pdf file
inverse.gif (22.97 KiB) Viewed 29257 times
This is the source
This is the source
barcodes.tif (11.74 KiB) Viewed 29262 times
mkoppanen
Posts: 309
Joined: 2007-06-09T07:06:32-07:00

Re: TIFF image conversion problem (inverse)

Post by mkoppanen »

xhenxhe wrote:I have group 4 Tiff file (attached) I run the following code to convert it to pdf

Code: Select all

$im = new Imagick('barcodes.tif');
$im->setFormat('PDF');
$im->writeImage('barcodes.pdf');
The result is an inverse of the original file. Has anyone experienced this. Is there a workaround?

I can change the compression to jpeg or something, but it makes the pdf file much larger.

Try $im->setImageCompression( Imagick::COMPRESSION_ZIP );
Mikko Koppanen
My blog: http://valokuva.org
mkoppanen
Posts: 309
Joined: 2007-06-09T07:06:32-07:00

Re: TIFF image conversion problem (inverse)

Post by mkoppanen »

By the way are you running Imagick on windows ?
Mikko Koppanen
My blog: http://valokuva.org
mkoppanen
Posts: 309
Joined: 2007-06-09T07:06:32-07:00

Re: TIFF image conversion problem (inverse)

Post by mkoppanen »

I tested this also and works here just fine (running Debian Etch / Imagick 2.0.0 / ImageMagick 6.3.6)
Mikko Koppanen
My blog: http://valokuva.org
xhenxhe

Re: TIFF image conversion problem (inverse)

Post by xhenxhe »

mkoppanen wrote:By the way are you running Imagick on windows ?
Yes, unfortunately it's a requirement I have :P

I'm testing this in XP / IIS / Imagick 2.0.0 / ImageMagick 6.3.3
xhenxhe

Re: TIFF image conversion problem (inverse)

Post by xhenxhe »

xhenxhe wrote:I'm testing this in XP / IIS / Imagick 2.0.0 / ImageMagick 6.3.3
I take that back. I'm using Imagick 2.0.0RC1

I'm not sure how to get the latest DLL for windows or how to update my ImageMagick version. Can you help me with that?
mkoppanen
Posts: 309
Joined: 2007-06-09T07:06:32-07:00

Re: TIFF image conversion problem (inverse)

Post by mkoppanen »

xhenxhe wrote:
xhenxhe wrote:I'm testing this in XP / IIS / Imagick 2.0.0 / ImageMagick 6.3.3
I take that back. I'm using Imagick 2.0.0RC1

I'm not sure how to get the latest DLL for windows or how to update my ImageMagick version. Can you help me with that?
You can't currently upgrade your ImageMagick version. We are working on getting dynamic builds and newer version of ImageMagick libraries for Imagick windows builds.

There are some other issues with the current build also, but I can not affect the ImageMagick version that is used to build Imagick DLLs.

Have you tried negateImage on these images?
Mikko Koppanen
My blog: http://valokuva.org
xhenxhe

Re: TIFF image conversion problem (inverse)

Post by xhenxhe »

mkoppanen wrote:Have you tried negateImage on these images?
Negate seems to work. I just fear the inconsistencies with Linux & Windows because some of my builds will be on Linux and some on IIS. Too bad I'm not a C programmers so I could help out with this project.

Maybe I could help with the documentation since that seems to be lacking right now.
mkoppanen
Posts: 309
Joined: 2007-06-09T07:06:32-07:00

Re: TIFF image conversion problem (inverse)

Post by mkoppanen »

xhenxhe wrote:
mkoppanen wrote:Have you tried negateImage on these images?
Negate seems to work. I just fear the inconsistencies with Linux & Windows because some of my builds will be on Linux and some on IIS. Too bad I'm not a C programmers so I could help out with this project.

Maybe I could help with the documentation since that seems to be lacking right now.
If you have time I'm more than glad to have help with that. Do you use IRC (thats the easiest way to get you started) ?
Mikko Koppanen
My blog: http://valokuva.org
Post Reply