Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Thumbnail or using Image preview type
Thils
Hi all,
I am using mediabin from Webservice API (using java). I have assets(images) in mediabin repository. and i need to get its thumbnail picture or image preview using previewtype to show it in my jsp. Is there any easier way of doing this from API?
Note : Performance also an issue here.
Thanks & Regards,
Senthil
Find more posts tagged with
Comments
BalajiMK
Have you tried "GetPreview" method?
Thils
Thanks for ur reply,
Yes i have tried getPreview() method, it returns only byte array. How can i preview th image in jsp?
Thanks ,
Senthil
BalajiMK
not sure about jsp.
But try this:
<img src="image.jsp"/>
image.jsp:
byte [] imgData = mediaBinServer.getPreview(assetID, revisionNumber, layerNumber, MBPreviewType.Preview_64x64); // revisionNumber = -1 and layerNumber = -1
response.setContentType("image/jpeg");
OutputStream o = response.getOutputStream();
o.write(imgData);
Thils
Hi, Thanks again for ur reply,
I tried this code, but getting the following error..
10:24:21,855 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException: getOutputStream() has already been called for this response
After i surfed in web, in that i found that it is better to use servlet rather than jsp for this..
Now i am trying this in servlet..
Thanks,
senthil