nonaguy Posted April 25, 2008 Share Posted April 25, 2008 My company wants a web application for local intranet use to view some 70,000 high quality tiffs (these are imaged historical documents). Our plan is to use php with imagemagick to load the images in memory, convert them, and echo out the results without touching the original tiffs. The problem here is that this is somewhat sluggish, averaging out at about 7 seconds an image. Are there any programs out there that specialize in speed processing? We would even consider speed over quality in this case (provided quality dip is not TOO horrible). Any help would be appreciated. Also, here is the php we are using: <?php $resolution=$_GET["res"]; $photopath="C:\\LightTPD\\htdocs\\"; $photo=$photopath."test.tif"; $imagesize = getimagesize($photo); if ($resolution == null) { $resolution = $imagesize[1]; } $cmdpath = "C:\\PROGRA~1\\IMAGEM~2.0-Q\\"; $cmd = $cmdpath."convert \"$photo\" -scale ".$resolution."x".$resolution." -strip -unsharp 0.2x0.6+1.0 -quality 87 JPG:-"; header('Content-type: image/jpg'); passthru($cmd); ?> P.S. We have tried other formats like JPEG-2000 and PNG, but they have proved unsuitable for our needs. JPEG-2000 reduces file size by half but triples the processing time, PNG reduces file size by about a third, but increases processing time by a small amount. We have also loaded the scripts on Lighttpd to reduce processing time furher. Quote Link to comment Share on other sites More sharing options...
MadTechie Posted April 25, 2008 Share Posted April 25, 2008 the problem you have is your opening another program on the server each time you process a file.. this in itself will cause a few seconds lag.. personally i would convert the files to jpeg and use them for displaying with the option of downloading the tiff version.. you could update the script to check if a jpg version exists, if not then create one (keep it on the server) thus each file will take 7 seconds (only once). Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted April 25, 2008 Share Posted April 25, 2008 will the new jpg file be saved or just outputted? Quote Link to comment Share on other sites More sharing options...
nonaguy Posted April 25, 2008 Author Share Posted April 25, 2008 the problem you have is your opening another program on the server each time you process a file.. this in itself will cause a few seconds lag.. personally i would convert the files to jpeg and use them for displaying with the option of downloading the tiff version.. you could update the script to check if a jpg version exists, if not then create one (keep it on the server) thus each file will take 7 seconds (only once). The reason we are not converting them all beforehand is that all together, these documents take up around 4 terabytes of storage space; and there is a strong possibility that even more documents will be uploaded. It's an issue of storage space. And the jpg will not be saved, just outputted. Quote Link to comment Share on other sites More sharing options...
mrdamien Posted April 25, 2008 Share Posted April 25, 2008 GD in PHP is faster for resizing images I think. (Unless its changed recently) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.