Is it possible to use timthumb.php inside JSP page

186 views Asked by At

I want to use timthumb.php for image resizing/cropping but my project is Java EE.

Is is possible to use something like this in my jsp page ?

 <div class="item" style="background: url('timthumb.php?src=http://www.products.com/img/main-banner-slider/updated_banner/promo2_thumb.jpg&w=900&q=100%') no-repeat center 0;') no-repeat center 0;">

Any possible ways and kind suggestions are welcomed.

1

There are 1 answers

0
Jason Sperske On BEST ANSWER

Unless you load a PHP processor into your app container (not impossible, but not easy) you best bet is to write your own image re-sized. JMagick is a great library to deal with this though I tend to use BufferedImages for it.

Also in your example you aren't actually trying to use PHP inside JSP, but rather you are referencing a PHP script in some CSS. There is no requirement that CSS reference an image on the same server (or even the same port (as long as you aren't using HTTPS))