Is saving images within the purpose of SDL_Image?

I’ve written some code for saving PNGs from SDL surfaces, and with a
little work it could be adjusted to use a SDL_Image-like API.
Would that (Image saving) be in line with the purpose of the SDL_Image
library, or should I look into creating something like a SDL_ImageSave
library?

(I asked this a month ago, but didn’t get any response about SDL_Image.
Since then, I adjusted the API in order to give more control over the
compression of the PNG files (That was one of the questions asked in
reply to my original post))

-Philip D. Bober

I think it would be nice to have saving in SDL_image, provided it can
be configured to compile with loading only. (For those who link
statically or include libs, and are worried about the binary size.)

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Tuesday 18 May 2004 18.23, Philip D. Bober wrote:

I’ve written some code for saving PNGs from SDL surfaces, and with
a little work it could be adjusted to use a SDL_Image-like API.
Would that (Image saving) be in line with the purpose of the
SDL_Image library, or should I look into creating something like a
SDL_ImageSave library?

(I asked this a month ago, but didn’t get any response about
SDL_Image. Since then, I adjusted the API in order to give more
control over the compression of the PNG files (That was one of the
questions asked in reply to my original post))

I also think it should be in SDL_Image.
There’s no point creating an SDL_ImageSave
unless the current one is renamed to SDL_ImageLoad :wink:

I wouldn’t be too worried about size…
If people are worried about size, chances are
they are not going to use SDL_Image anyway…

Why would you want to include support for a zillion
different formats if size is an issue?
You’re probably better off ripping the code for a
particular format you’re interested in.

cheers,
k.> ----- Original Message -----

From: David Olofson [mailto:david@olofson.net]
Sent: 18 May 2004 17:34
To: A list for developers using the SDL library. (includes SDL-announce)
Subject: Re: [SDL] Is saving images within the purpose of SDL_Image?

On Tuesday 18 May 2004 18.23, Philip D. Bober wrote:

I’ve written some code for saving PNGs from SDL surfaces, and with
a little work it could be adjusted to use a SDL_Image-like API.
Would that (Image saving) be in line with the purpose of the
SDL_Image library, or should I look into creating something like a
SDL_ImageSave library?

(I asked this a month ago, but didn’t get any response about
SDL_Image. Since then, I adjusted the API in order to give more
control over the compression of the PNG files (That was one of the
questions asked in reply to my original post))

I think it would be nice to have saving in SDL_image, provided it can
be configured to compile with loading only. (For those who link
statically or include libs, and are worried about the binary size.)

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Hello !

I also think it should be in SDL_Image.
There’s no point creating an SDL_ImageSave
unless the current one is renamed to SDL_ImageLoad :wink:

I wouldn’t be too worried about size…
If people are worried about size, chances are
they are not going to use SDL_Image anyway…

That is 100% what i think :slight_smile:

CU

Agreed.

/Olof

Torsten Giebl: "RE: [SDL] Is saving images within the purpose of…

#Hello !#
#> I also think it should be in SDL_Image.
#> There’s no point creating an SDL_ImageSave
#> unless the current one is renamed to SDL_ImageLoad :wink:
#>
#> I wouldn’t be too worried about size…
#> If people are worried about size, chances are
#> they are not going to use SDL_Image anyway…

#That is 100% what i think :slight_smile:

#CU

#_______________________________________________
#SDL mailing list
#SDL at libsdl.org
#http://www.libsdl.org/mailman/listinfo/sdl

I think it would be nice to have saving in SDL_image, provided it can
be configured to compile with loading only. (For those who link
statically or include libs, and are worried about the binary size.)

Same opinion here. Please make two versions, one with and one without
saving.

Actually, it would be great to have a SDL_Image that handles only PNG
and JPEG, since that’s all I need, but well… :wink:

(yes, I know I can use libjpeg and libpng without SDL_Image, but it’s
much easier to use SDL_Image and removes lots of coding time)–
Please remove “.ARGL.invalid” from my email when replying.
Incoming HTML mails are automatically deleted.

I think it would be nice to have saving in SDL_image, provided it
can be configured to compile with loading only. (For those who
link statically or include libs, and are worried about the binary
size.)

Same opinion here. Please make two versions, one with and one
without saving.

Two binary versions, that is…? That was what I was thinking
anyway. (I think it would be a bad idea to fork the lib; there should
only be one source tree, since this is just a configure option.)

Actually, it would be great to have a SDL_Image that handles only
PNG and JPEG, since that’s all I need, but well… :wink:

./configure --disable-gif --disable-lbm --disable-pcx --disable-pnm
–disable-tga --disable-xpm

make

(That includes BMP as well, but that just calls SDL anyway.)

Now, put the lib/so/DLL/whatever where you want it and link with it,
or throw it into your binary distros.

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Tuesday 18 May 2004 20.30, Olivier Fabre wrote:

David Olofson wrote:

I think it would be nice to have saving in SDL_image, provided it can
be configured to compile with loading only. (For those who link
statically or include libs, and are worried about the binary size.)
In my code I emulated how SDL_Image uses defines, so in order to get PNG
saving both IMG_PNG and IMG_SAVE_PNG have to be defined.
(Configure or the workspace would predefine those by default)
So it’s no problem to compile without PNG saving (or without
PNG,JPEG,etc. loading)

-Philip D. Bober

Two binary versions, that is…? That was what I was thinking
anyway. (I think it would be a bad idea to fork the lib; there should
only be one source tree, since this is just a configure option.)

Yes, of course… using defines.

./configure --disable-gif --disable-lbm --disable-pcx --disable-pnm
–disable-tga --disable-xpm

Oh, nice :-).

I’m using DevC++ though so I’ll have to check which defines that
triggers in order to include that in the project options.

Thanks for the info!

(ATM I’m simply using a precompiled DLL - and it should be enough for a
while. But it could be useful some day, when I have to pay for
bandwidth or something :-} )On 18/05/2004, David Olofson, you wrote:


Please remove “.ARGL.invalid” from my email when replying.
Incoming HTML mails are automatically deleted.