Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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
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: 217
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
Saloon Keeper

Joined: Jan 17, 2008
Posts: 2670
    
  31

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
 
It's not a secret anymore!