• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Image corruption  RSS feed

 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not have much experience in image manipulation. I am trying to take an upload from webapp place into the database and retrieve with a servlet (which dynamically resizes the image). Everything works except sometimes the image, which are all jpg, turn grey halfway through the drawing process. Since this occurs no matter how the image is dynamically sized, I can only assume that it is being stored in the db that way during the upload. Could someone browse through my code and see if there is anything that would cause this?



BTW, getInputStream() is called on a struts FormFile, so that shouldn't be the problem.
 
Bartender
Posts: 9520
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ImageIO.read() returns a BufferedImage, so there's no need to "convert".
I don't see anything else obvious here. you should try writing the image out to a file before resizing it. Then you can see if your problem is on the input or output side.
 
Kerry Wilson
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BTW, I solved the problem!

The column that I am storing it in was a BLOB, which only holds 16KB. I changed to MEDIUMBLOB with holds 16MB. Thanks for the help.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!