Skip to main content

Anybody here?How to get the size of a planarImage?

2 replies [Last post]
zhaojunwang
Offline
Joined: 2006-06-17
Points: 0

as the title said, I wonder how to get the size(image file size measured by byte,not dimension) of a planarimage before stored to the disk?

Reply viewing options

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

It depends whether you are compressing it or not. If you are not compressing
it you could do what James suggested or just use the various descriptive
paramaters (width, height, etc.) to compute it. If you are compressing it then
you cannot know precisely. The best you could do would be to obtain a probable
extreme compression ratio for the type of compression you are using and use
that to guess.

Brian

On Mon, 5 Feb 2007, jai-interest@javadesktop.org wrote:

> as the title said, I wonder how to get the size(image file size measured by byte,not dimension) of a planarimage before stored to the disk?

----------------
Brian Burkhalter
Java Media, 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

jxc
Offline
Joined: 2005-02-24
Points: 0

Maybe you could encode the image into a byte array before storing it into a file.

-James