Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Image Rotation

 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I used the below code to rotate the images. But this is not supporting TIFF formats. I heard that JAI will be used for rotating TIFF images. Could some advice how to download JAI jar and any samples to rotate



 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean you can't *store* the image as TIFF. Rotating an image in memory is independent of the format in which it will be stored later (if it's even going to be stored).

You don't need JAI, you need TIFF support for ImageIO. That is provided by the Java Advanced Imaging Image I/O Tools.

By the way, storing an image in BMP format with a JPG file extension is rather strange.
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf,

I tried with the below code and its rotating the image and saving it as out file but still am getting the exception



I my client machine in UNIX and I dont want to install the native lib. Please advice to override this error

 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Getting strange warning about not loading mediaLib

In case you see a warning message like the following when running your application:

Error: Could not load mediaLib accelerator wrapper classes. Continuing in pure Java mode.

Occurs in: com.sun.media.jai.mlib.MediaLibAccessorcom.sun.media.jai.mlib.MediaLibLoadException

This means that you did not install properly the native libraries and then JAI is working in pure JAVA mode.


Forcing Pure-Java mode

JAI can be run without its native acceleration layer without loss of functionality. This may be accomplished by setting the JVM switch com.sun.media.jai.disableMediaLib to true, which means starting the JVM adding the following parameters:

-Dcom.sun.media.jai.disableMediaLib=true



Still my client is not accepting to chnage JVM settings. As a result this may cause some other issues. Please assit me with some other suggestions.
 
Brian Legg
Ranch Hand
Posts: 488
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought JAI was Java Advanced Imaging?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JAI is just about dead. I'd advise to go with the original code, and then to use ImageIO for handling TIFFs.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic