Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

saving image to a file

3 views
Skip to first unread message

Rolf Schaller

unread,
Sep 26, 2000, 3:00:00 AM9/26/00
to
Hi,
I am working on a java program (using AWT) that will read a gif or jpeg
image from an URL and draws it in a Pane. After that it reads some
information from a database and draws something in the pane. This works
quit well.
My question is how do I save the image I have created into a file in gif
or jpeg format. Is it as easy as reading an image? Is there information
on the Web about this?
Thanks Rolf


Michiel de Roo

unread,
Sep 26, 2000, 3:00:00 AM9/26/00
to
Search for JIS, Java Image Saving library.

Marco Schmidt

unread,
Sep 26, 2000, 3:00:00 AM9/26/00
to
On Tue, 26 Sep 2000 10:36:21 +0200, Rolf Schaller
<scha...@tfd.mw.tu-dresden.de> wrote:

>My question is how do I save the image I have created into a file in gif
>or jpeg format. Is it as easy as reading an image? Is there information
>on the Web about this?

I've listed several libraries that read and write popular image file
formats at
http://www.geocities.com/~marcoschmidt/java-image-coding.html

Regards,
Marco

Ron Baalke

unread,
Sep 26, 2000, 3:00:00 AM9/26/00
to
In article <WLbQOXmE8yAzEG...@4ax.com>, marcos...@geocities.com writes...

Are there any libraries that can be used inside of applets to save images?
A quick look at the libraries here looks like none of them will work
for applets.

Ron

Marco Schmidt

unread,
Sep 26, 2000, 3:00:00 AM9/26/00
to
On 26 Sep 2000 16:31 UT, baa...@kelvin.jpl.nasa.gov (Ron Baalke)
wrote:

>Are there any libraries that can be used inside of applets to save images?
>A quick look at the libraries here looks like none of them will work
>for applets.

Applets have a general problem of not being able to write files. But
once you changed security settings (registering signed applets etc., I
don't know a lot about them), the libraries should work like any other
piece of Java code. Few of them (if any) use native code, IIRC.

Regards,
Marco

Ron Baalke

unread,
Sep 26, 2000, 3:00:00 AM9/26/00
to
In article <ROfQOXLZcOD5BQ...@4ax.com>, marcos...@geocities.com writes...

>On 26 Sep 2000 16:31 UT, baa...@kelvin.jpl.nasa.gov (Ron Baalke)
>wrote:
>
>>Are there any libraries that can be used inside of applets to save images?
>>A quick look at the libraries here looks like none of them will work
>>for applets.
>
>Applets have a general problem of not being able to write files.

Exactly. Which is why the libraries you mentioned won't work inside
applets.

>But
>once you changed security settings (registering signed applets etc., I
>don't know a lot about them), the libraries should work like any other
>piece of Java code. Few of them (if any) use native code, IIRC.

I've ruled out signed applets since neither Netscape or Internet Explorer
support signed applets.

I ask again:

Are there any libraries that can be used inside of applets to save images?

Ron

canardbw

unread,
Sep 26, 2000, 3:00:00 AM9/26/00
to
I wrote a self-signed applet that saves an image to a file on the
users machine. The codec I used to save the jpg is included with
Sun's JDK1.3. It is fairly buried in something like
com.sun.java.jpeg.codec or something similar. I use Sun's
plug-in for my applet to provide consistency and to use the newer
version of java.
Just one suggestion that has worked well for me.

Brad


Ben Clifford

unread,
Sep 27, 2000, 3:00:00 AM9/27/00
to
On 26 Sep 2000 20:16 UT, Ron Baalke <baa...@kelvin.jpl.nasa.gov> wrote:

>>Applets have a general problem of not being able to write files.
>
>Exactly. Which is why the libraries you mentioned won't work inside
>applets.

[...]


>I ask again:
>Are there any libraries that can be used inside of applets to save images?

So where do you want the images to be saved, if not to a file?
Back to the server that they came from?

--
http://www.ben.custom-access.net/
GPG key: 30F06950. You are encouraged to sign and encrypt correspondence.


Ron Baalke

unread,
Sep 27, 2000, 3:00:00 AM9/27/00
to
In article <slrn8t38b...@krustbustr.benzone.org>, be...@benzone.freeserve.co.uk writes...

>On 26 Sep 2000 20:16 UT, Ron Baalke <baa...@kelvin.jpl.nasa.gov> wrote:
>
>>>Applets have a general problem of not being able to write files.
>>
>>Exactly. Which is why the libraries you mentioned won't work inside
>>applets.
>[...]
>>I ask again:
>>Are there any libraries that can be used inside of applets to save images?
>
>So where do you want the images to be saved, if not to a file?
>Back to the server that they came from?

Actually, I do want the images saved to a file, and on the server would
suffice. For security reasons, applets cannot directly write to files, but
I understand there are ways around it, such as sending the image data
to another program that resides on the same server, which then writes
it to disk. I was hoping that someone had already done this. Someone
mentioned signed applets would work as well, but requires installing
a plugin on the browser (yuck!).

Ron

0 new messages