This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes How to display the best quality of a photo Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "How to display the best quality of a photo" Watch "How to display the best quality of a photo" New topic
Author

How to display the best quality of a photo

sam White
Ranch Hand

Joined: Feb 18, 2011
Posts: 208
Hi,
With spring 3.0.7, cxf webservices, jsp and mysql 5,
I currently store all image in midiumblob data type in mysql database.
When I retrieve it and display, I found the quality is degraded or not as good as the photo that I have taken using my digital camera.

here is the code I used to display the image. It is written in the controller java class:



ImageUtils.bufferedImageToByteArray() function:



Any suggestion is very appreciated.
Thanks
Sam
Jayesh A Lalwani
Bartender

Joined: Jan 17, 2008
Posts: 2271
    
  28

You will always have degradation when you scale images. I am not familiar with the Scalr library that you are using to scale the image. You might want to look into the API for Scalr more
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to display the best quality of a photo
 
Similar Threads
java.lang.IllegalArgumentException: im == null!
image manipulation
ImageIO.read() timeout?
How to send image over a network
Null check on an image