I am designing a small, commercial website that requires an administration page where the owner can upload photos and update the inventory table. It was coming along just fine until I found out, by brute force, that Dreamhost does not allow a PHP script to execute the Image Magick commands required to resize the photos.

So I'm asking someone for help. I need a barebones python script with functionality to grab the uploaded photos, mogrify them < /usr/bin/mogrify -resize 600x450 *jpg >. From that functionality, I can develop the simpler stuff to rename and print a validation page.

Please help. This has really set me back. Client is growing impatient. Thank you.

More details, please. Here's what I think I understand:

* You want the script to download the photos,
* Execute the mogrify command, and
* rename and print a validation page.

So: where are the photos currently? At a URL? on the user's HDD?

You want to rename the photos? Print a validation page on clientside?

Jeff

please view my progress at tefflox.net/clients/superiorminitrucks/admin, a standard upload and validation page.

right now I am forced to ask the client to use shrinkpictures.com, and then use the admin page to upload them.


right now the problem I face is in the passing of data from index.php to upload.php, and finally to confirm_update.php, a preview and commit page.

a basic javascript problem, i guess. though I welcome suggestions on how to run the image conversions without the PHP exec() command..

thanks

Got it. From their website, I see that DreamHost runs Debian, so your hope is that their server will have /usr/bin/mogrify available?

Try this:

Then,

import os

os.execl("/usr/bin/mogrify","-resize", "600x450", "*jpg")

(you might be able to combine the parameters into a single string)

But I wonder whether this will be allowed, either...

Jeff

thanks. i will try this today.

i did quite a bit of work on the php page, so it may be difficult to abandon that script.

the tech support rep did say that "Perl or Python or Bash (not recommended)" will work.

Thanks!

Got it. From their website, I see that DreamHost runs Debian, so your hope is that their server will have /usr/bin/mogrify available?

Try this:

Then,

import os

os.execl("/usr/bin/mogrify","-resize", "600x450", "*jpg")

is there a way that i can run this code from within, or sourced from, the php page. i worked almost all day on the php page...

yes, /usr/bin/mogrify and /usr/bin/convert are available at the command line on the dreamhost server.

This article has been dead for over six months. Start a new discussion instead.