Skip to main content

Converting gif to bmp problem

2 replies [Last post]
david@windward.net
Offline
Joined: 2006-02-14
Points: 0

Hi;

When I go to convert a gif to a bmp, I get a BMPImageWriteParam. It returns true to canWriteCompressed() - which is correct I believe - like RLE.

It then throws an exception on setCompressionQuality(0.95f) - why?

thanks - dave

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Brian Burkhalter

Is the compression mode set to

http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/ImageWriteParam.ht...

as required by

http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/ImageWriteParam.html#setCompressionQuality(float)

?

Also, please note that as of Java 5 (J2SE/JDK/JRE 1.5), BMP and WBMP are
supported by the javax.imageio Java Image I/O Framework as well as by
JAI-Image I/O Tools. We recommend that if you are using Java 5 or newer that
you use the javax.imageio BMP and WBMP plug-ins as, unlike for the JPEG and
PNG plug-ins, our [W]BMP plug-ins do not provide any advantage over those in
core J2SE.

Brian

On Thu, 17 Nov 2005, jai-interest@javadesktop.org wrote:

> Hi;
>
> When I go to convert a gif to a bmp, I get a BMPImageWriteParam. It returns true to canWriteCompressed() - which is correct I believe - like RLE.
>
> It then throws an exception on setCompressionQuality(0.95f) - why?
>
> thanks - dave
> ---
> [Message sent by forum member 'david@windward.net' (David Thielen)]
>
> http://www.javadesktop.org/forums/thread.jspa?messageID=125676&#125676
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> For additional commands, e-mail: interest-help@jai.dev.java.net
>
>

----------------
Brian Burkhalter
Java Multimedia, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

david@windward.net
Offline
Joined: 2006-02-14
Points: 0

Yes, my code is:
if (writeParam.canWriteCompressed()) {
writeParam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
writeParam.setCompressionQuality(0.95f);
}

Reading the docs I think this is correct. Am I missing something?

thanks - dave