Jump to content

Speedy Image Processing


nonaguy

Recommended Posts

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.

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.