I have a problem with an application that uses the GD PHP library, it takes an image and creates a thumbnail/cropping based on it. This applications searches in the database for information related to the image so we can name it and assign it to a client.
The problem is that the image processing (creating or copying images) is slowing down our database server.
There is another way to do image processing (thumbnails/cropping) without affecting the server performance so much? A desktop application with Python to do the cropping on local and then transfer them via SSH?
On the second question, I’d like some pointer on which Python libraries to use for desktop and image proccessing.
If doing the cropping locally before uploading makes sense for your use case, then yes, it’s a great idea.
The first question is, do you really need to use Python at all? If you’ve got, say,
ImageMagickinstalled, a call toconvertfollowed byscpis a 2-linebashscript, and rewriting it as a 5-line Python script may not make it any more readable.But if you do want to do it with Python, here are some choices:
gd, and have somegdcode in PHP to port, maybe use a Pythongdwrapper, such as gdmodule.ImageMagickdoes everything in the universe, including this.PILis the closest thing to a standard image library for Python.Meanwhile, for doing the SSH copy, you’ll probably want to use paramiko.