开发者

Scaling image from php with external tool

In a php project I have the problem, that my开发者_如何学Python provider doesn't allow me to set the memory-limit of my script higher. Therefore my script breaks if a user uploads a huge image file and I try to scale it down to safe it on the server.

My idea was to run an exec() command to use an external tool but did not find any examples. Is it possible to do so? Or should I try to scale the image down before upload, using javascript?

Or is there an other way to handle, I haven't even thought about..?

Thanks for your help!


Use a client-side uploader with resizing/scaling capabilities. This will make sure that big images are scaled down before reaching your server. JumpLoader is a good one.


You can try a

exec("convert source_image.jpg -resize 64x64 target_image.jpg")

to see whether ImageMagick is available.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜