0

I am trying to generate thumbnail on the fly using phpThumb() library. It is working fine for those images store in my server. But it is not generating thumbnail for external images. Reference :- http://phpthumb.sourceforge.net/demo/demo/phpThumb.demo.demo.php

Working :-

<img border="0" src="../phpThumb.php?src=images/disk.jpg&amp;w=300&amp;hash=ec4f5e1b9224180800c7ae9f88758a2b" alt="">

Not working:-

<img border="0" src="../phpThumb.php?src=http://externaldomain.com/images/anyimages.jpg&amp;w=300&amp;hash=ec4f5e1b9224180800c7ae9f88758a2b" alt="">

Can anyone guide me if I doing anything wrong here. Or any other php thumbnail library can help me??

Thanks in advance.

Roopendra
  • 7,674
  • 16
  • 65
  • 92
  • I can't see anywhere in the demo where it supports images that are external files. You may want to download the external image, and then use a local copy to display to the user. – Jonno_FTW May 31 '13 at 05:11
  • @Jonno_FTM : thanks. Any other library do you know which make my life easy?? – Roopendra May 31 '13 at 05:14
  • I'm not sure you're going about this the right way. It will certainly slow page loads time if you have to fetch the external image and create a thumbnail of it every time the page loads (this is essentially stealing bandwidth). I suggest you download the images you want, store it on the server, and then serve the thumbnail using the existing library. If it's dynamic images you want, you can set up a caching system that is nearly the same. – Jonno_FTW May 31 '13 at 05:20
  • @Jonno_FTW : thanks a lot for your valuable suggestion. – Roopendra May 31 '13 at 05:29

0 Answers0