Resizing the image in php for viewing purposes only

后端 未结 15 1707
面向向阳花
面向向阳花 2020-12-14 13:09

Okay, the reason I posted this is because I wasn\'t sure what to search for. I\'ll try to explain it as clearly as I can.

Say, I have an image sized 800x600. The box

15条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-14 13:17

    It is very easy to use here is the class https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/timthumb/timthumb.php here are the params http://viralpatel.net/blogs/resize-image-dynamically-php/ I have tested looks works great

    example is < img src="/script/timthumb.php?src=/some/path/myimage.png&w=100&h=80" alt="resized image" />

    Remember that you should be careful to use this, If you do not create regex validation for input params you may have security vulnerability. That's why they deprecated this lib, but it works perfect.

提交回复
热议问题