• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Advanced Imaging  RSS feed

 
Tom Sullivan
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are using a Java image viewer with our application which will open and also rotate images. But, it won't save the rotations.

Setting the image rotation is no problem for view in our system despite the fact that the image viewer won't save it. We can simply get the rotation with the image viewer�s getRotation(int angle) and getPage(the page to be rotated in multi-page tiff) method, put the angle int and page number int in the DB and then apply the rotation angle to the image through the setRotation() method of this same viewer when it is opened. The problem is that the images are not only used in our viewer (the viewer is a commercial application but not ours... we just tied it in to our software).

The images come in from a fax server. We grab them and the user does work through our workflow system. Once the user is done, we release the images for import into another system that the client maintains. We need to somehow take the image rotation provided by the viewer and to then either add something to the image which will tell other viewers how to display it and/or rewrite the image so that it is automatically displayed right side up. As I am not familiar with the Advanced Imaging API (and know little about imaging from a development standpoint in general), I am hoping that someone here is familiar and might be able to point me to some ideas that may solve this problem.

A little info on where to learn about tiff tags and how to set them through the API might help (I am just guessing here). Perhaps the image needs to be rewritten with the tags updated? Any ideas�?
[ January 17, 2006: Message edited by: Tom Sullivan ]
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There may be an easier way to do this, but if you aren�t afraid of a bit of programming I think you can do the following. The public domain image processor ImageJ has classes called TiffEncoder and TiffDecoder for reading and writing TIFF images. Internally those classes use ImageJ�s in-memory format, but that doesn�t matter much, because you aren�t going to process them. Looking at the source of these classes, I see that they use a TIFF tag for storing information that�s specific to ImageJ (look for �description� in the source). It seems that you could use that to store whatever data you like, with only minimal changes to the source required. You�d also need to create a FileInfo object, which mainly specifies the filename and path, but that shouldn�t be a problem.

Maybe this makes no sense to read (it does to me, but I know ImageJ very well); what I'm suggesting is to use it as a library solely for reading TIFFs, adding the information you need to preserve, and storing the image back to disk. There'd be very few classes involved you'd have to look at.
[ January 17, 2006: Message edited by: Ulf Dittmer ]
 
Tom Sullivan
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf. That is where I will begin.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!