Page 1 of 1

Converting big tiff's to jpg's

Posted: 2009-02-02T11:00:34-07:00
by benny
I'm completely new to ImageMagick but I'm already very impressed.

The thing I use ImageMagick for is to convert big tiff files (at least 20 mb) to small jpg's. I have tried bigger files, around 80 mb but that did not work. I only got a empty jpg file, 0 bytes in size. I think it's a ram memory problem or what do you guys think? I'm using it from PHP.

Is there a better way to do this?

Code: Select all

<?php

$exec = "convert input.tif -units PixelsPerInch -density 72 -quality 60 -resize 535 output.jpg";

?>

Re: Converting big tiff's to jpg's

Posted: 2009-02-03T18:43:52-07:00
by anthony
This is probably un-related, but if -units and -density is for the TIF image then it should be before reading the TIF image. But if it is for the JPG what you have is fine.

As for your problem, do you have a link to the input.tif so we can download (Arrgghh 20Mbytes!!!) and test it out?

Re: Converting big tiff's to jpg's

Posted: 2009-02-04T13:07:21-07:00
by benny
You can use this image for example:

http://imgsrc.hubblesite.org/hu/db/imag ... ll_tif.tif

Around 27 MB

Re: Converting big tiff's to jpg's

Posted: 2009-02-04T13:22:41-07:00
by magick
You may need to adjust your memory and execution time in your php.ini configuration file. In the mean-time try this from the command line:
  • convert -limit memory 32 -limit map 64 input.tif -units PixelsPerInch -density 72 -quality 60 -resize 535 output.jpg
The command worked without complaint on our Linux server using ImageMagick 6.4.9-1, the current release. It also works without the -limit options.

Re: Converting big tiff's to jpg's

Posted: 2009-02-05T01:28:54-07:00
by benny
Thanks a lot for your fast answer, I will try it.
magick wrote:You may need to adjust your memory and execution time in your php.ini configuration file. In the mean-time try this from the command line:
  • convert -limit memory 32 -limit map 64 input.tif -units PixelsPerInch -density 72 -quality 60 -resize 535 output.jpg
The command worked without complaint on our Linux server using ImageMagick 6.4.9-1, the current release. It also works without the -limit options.

Re: Converting big tiff's to jpg's

Posted: 2009-03-12T03:10:28-07:00
by benny
About a week ago I used the script on my webhost. It worked perfectly. I know that my webhost made an update to the server and after that it does not work. They have ImageMagick version 6.2.6 installed. Can someone please tell me what you think the problem can be? I get no error messages at all. Can it be a memory related problem at the server? memory_limit is set to 32 MB right now, maybe I need more... I don't know how much memory I had before the update to the server because I did not look.

Need I tell you that I will change the webhost... It's my lucky day that I have no customers yet.