Hi,

I'm writing a small image stock application that stores EPS files (that's
what the client is using for their work).

Since GD doesn't support EPS, the only alternative I've found to create
thumbnails is to use the 'convert' utility from ImageMagick.

When testing it on the command line and from a .php script run from shell,
everything works okay - running 'convert infile.eps outfile.jpg' generates a
JPG thumbnail in outfile.jpg.

But when that same piece of code is run from a .php script under Apache,
things get really weird.

What the actual script does is that it goes through a "dropbox" directory,
creates two thumbnail versions of each EPS (200px, 600px) and moves them to
the appropriate location. I've been running the latest tests with a set of
eight EPS files, ca 7-10mb each. The thumbnails should become ~25kb for the
200px version, ~50-60kb for the 600px one.

Here's the "ls" output of the directory after a try at running the script (I
commented out moving the thumbnails for testing):

--- 8< ---

-rw-r--r--   1 www    wheel         0 Jun 30 03:27
Allahindlus.eps-832-lthumb.jpg
-rw-r--r--   1 www    wheel         0 Jun 30 03:27
Allahindlus.eps-832-sthumb.jpg
-rw-r--r--   1 www    wheel      8192 Jun 30 03:27
Palmolive-seebid-2.eps-832-lthumb.jpg
-rw-r--r--   1 www    wheel      8192 Jun 30 03:27
Palmolive-seebid-2.eps-832-sthumb.jpg
-rw-r--r--   1 www    wheel     16384 Jun 30 03:27
Palmolive_2.eps-832-lthumb.jpg
-rw-r--r--   1 www    wheel     16384 Jun 30 03:27
Palmolive_2.eps-832-sthumb.jpg
-rw-r--r--   1 www    wheel     16384 Jun 30 03:27
SEEMNESAI.eps-832-lthumb.jpg
-rw-r--r--   1 www    wheel     16384 Jun 30 03:27
SEEMNESAI.eps-832-sthumb.jpg
-rw-r--r--   1 www    wheel     16384 Jun 30 03:27
SULETEKK.eps-832-lthumb.jpg
-rw-r--r--   1 www    wheel     16384 Jun 30 03:27
SULETEKK.eps-832-sthumb.jpg
-rw-r--r--   1 www    wheel     16384 Jun 30 03:27
SULETEKK_2.eps-832-lthumb.jpg
-rw-r--r--   1 www    wheel     16384 Jun 30 03:27
SULETEKK_2.eps-832-sthumb.jpg
-rw-r--r--   1 www    wheel     16384 Jun 30 03:27
VIINISAI.eps-832-lthumb.jpg
-rw-r--r--   1 www    wheel     16384 Jun 30 03:27
VIINISAI.eps-832-sthumb.jpg
-rw-r--r--   1 www    wheel     16384 Jun 30 03:27
ZOTARELLA.eps-832-lthumb.jpg
-rw-r--r--   1 www    wheel     16384 Jun 30 03:27
ZOTARELLA.eps-832-sthumb.jpg

--- 8< ---

Weird, isn't it - the first two files are 0 bytes, the next ones are 8K, and
the remaining are 16KB. A quick look tells that for those >0kb, the
beginning of the file is correct, it's just cut off at either 8 or 16K.

Following the suggestions on #php, I've tried all the possible methods
(exec, system, passthru, shell_exec, backticks) with and without all the
optional parameters (that trigger (a)synchronous running on some of those).
Same results.

I'm really at a loss (and at a deadline) here. Any ideas ... ?

The server is running FreeBSD 5.2.1, Apache 1.3, PHP 4.3.6. ImageMagick
version 6.0.2 if that matters.


PS. I'll try to watch for replies on lists.php.net, but since I'm not
subscribed, I would really appreciate CC:-ing me on the reply.


-- 
Indrek

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to