This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JPEGImageEncoder problem  RSS feed

 
John Wood
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am seeing the following problem using JPEGImageEncoder to create a .jpg file: If I try to view the created .jpg file with MS Photo Editor, I see a 'Error Reading File' error box pop up. The image is viewable if I use a Java program to view it. Does anyone know what is going on here?
Thanks in advance...
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"WoodChucker" -

Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy.
You can change it here.

If you could post the code where you set up your JPEGEncoder and write to it (along with creating a BufferedImage, if you are using one) it would help a lot. It may be that the encoding params on the JPEG are something that is not recognized by MS Photo Editor... have you tried opening it in a browser?

This example code generates an image that I can open in MS Photo Editor... see if you can, too...


Thanks! and welcome to the JavaRanch!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!