Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL_image 2.8.0 #2596

Merged
merged 8 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-ubuntu-sdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
sudo apt-mark hold grub-efi-amd64-signed
sudo apt-get update --fix-missing
sudo apt-get upgrade
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev libjpeg-dev python3-setuptools python3-dev
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev python3-setuptools python3-dev
pip3 install sphinx"<7.2.0" numpy>=1.21.0

- name: Make sdist and install it
Expand Down
4 changes: 1 addition & 3 deletions buildconfig/Setup.Android.SDL2.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ SDL = {sdl_includes} -D_REENTRANT -DSDL2 -lSDL2
FONT = {sdl_ttf_includes} -lSDL2_ttf
IMAGE = {sdl_image_includes} -lSDL2_image
MIXER = {sdl_mixer_includes} -lSDL2_mixer
JPEG = {jpeg_includes} -ljpeg
SCRAP =
PNG = {png_includes} -lpng16
FREETYPE = {freetype_includes} -lfreetype -lharfbuzz

DEBUG =
Expand All @@ -15,7 +13,7 @@ DEBUG =
#everything you can, but you can ignore ones you don't have
#dependencies for, just comment them out

imageext src_c/imageext.c $(SDL) $(IMAGE) $(PNG) $(JPEG) $(DEBUG)
imageext src_c/imageext.c $(SDL) $(IMAGE) $(DEBUG)
font src_c/font.c $(SDL) $(FONT) $(DEBUG)
mixer src_c/mixer.c $(SDL) $(MIXER) $(DEBUG)
mixer_music src_c/music.c $(SDL) $(MIXER) $(DEBUG)
Expand Down
2 changes: 0 additions & 2 deletions buildconfig/Setup.Emscripten.SDL2.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
#FONT = -lSDL2_ttf
#IMAGE = -lSDL2_image
#MIXER = -lSDL2_mixer
#JPEG = -ljpeg
#SCRAP =
#PNG = -lpng
#FREETYPE = -lfreetype -lharfbuzz

DEBUG =
Expand Down
4 changes: 1 addition & 3 deletions buildconfig/Setup.SDL2.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ SDL = -I/usr/include -D_REENTRANT -DSDL2 -lSDL2
FONT = -lSDL2_ttf
IMAGE = -lSDL2_image
MIXER = -lSDL2_mixer
PNG = -lpng
JPEG = -ljpeg
SCRAP = -lX11
PORTMIDI = -lportmidi
PORTTIME = -lporttime
Expand All @@ -25,7 +23,7 @@ DEBUG =
#everything you can, but you can ignore ones you don't have
#dependencies for, just comment them out

imageext src_c/imageext.c $(SDL) $(IMAGE) $(PNG) $(JPEG) $(DEBUG)
imageext src_c/imageext.c $(SDL) $(IMAGE) $(DEBUG)
font src_c/font.c $(SDL) $(FONT) $(DEBUG)
mixer src_c/mixer.c $(SDL) $(MIXER) $(DEBUG)
mixer_music src_c/music.c $(SDL) $(MIXER) $(DEBUG)
Expand Down
2 changes: 0 additions & 2 deletions buildconfig/config_darwin.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ def main(auto_config=False):
]

DEPS.extend([
Dependency('PNG', 'png.h', 'libpng', ['png']),
Dependency('JPEG', 'jpeglib.h', 'libjpeg', ['jpeg']),
Dependency('PORTMIDI', 'portmidi.h', 'libportmidi', ['portmidi']),
Dependency('PORTTIME', 'porttime.h', '', []),
find_freetype()
Expand Down
6 changes: 2 additions & 4 deletions buildconfig/config_emsdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

# user build, make sure ports are pulled in.
if os.environ.get("SDK_VERSION", None) is None:
EMCC_CFLAGS += " -sUSE_SDL=2 -sUSE_LIBPNG -sUSE_LIBJPEG"
EMCC_CFLAGS += " -sUSE_SDL=2"
else:
# make sure CI only pick SDK components.
SDKROOT = os.environ.get("SDKROOT", "/opt/python-wasm-sdk")
Expand Down Expand Up @@ -151,7 +151,7 @@ def configure(self, incdirs, libdirs):
self.found = 1
else:

if self.name in ["FONT", "IMAGE", "MIXER", "PNG", "JPEG", "FREETYPE"]:
if self.name in ["FONT", "IMAGE", "MIXER", "FREETYPE"]:
self.found = 1
print(
self.name
Expand Down Expand Up @@ -216,8 +216,6 @@ def main(auto_config=False):
]
DEPS.extend(
[
Dependency("PNG", "png.h", "libpng", ["png"]),
Dependency("JPEG", "jpeglib.h", "libjpeg", ["jpeg"]),
# Dependency('SCRAP', '', 'libX11', ['X11']),
# Dependency('GFX', 'SDL_gfxPrimitives.h', 'libSDL_gfx.a', ['SDL_gfx']),
]
Expand Down
2 changes: 0 additions & 2 deletions buildconfig/config_unix.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,6 @@ def find_freetype():
#Dependency('GFX', 'SDL_gfxPrimitives.h', 'libSDL2_gfx.so', ['SDL2_gfx']),
]
DEPS.extend([
Dependency('PNG', 'png.h', 'libpng', ['png']),
Dependency('JPEG', 'jpeglib.h', 'libjpeg', ['jpeg']),
Dependency('SCRAP', '', 'libX11', ['X11']),
#Dependency('GFX', 'SDL_gfxPrimitives.h', 'libSDL_gfx.so', ['SDL_gfx']),
])
Expand Down
20 changes: 5 additions & 15 deletions buildconfig/config_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,13 @@ def _add_sdl2_dll_deps(DEPS):
DEPS.add_dll(r'(lib)?opus[-0-9]*\.dll$', 'opus', ['*opus-[0-9]*'])
DEPS.add_dll(r'(lib)?opusfile[-0-9]*\.dll$', 'opusfile', ['*opusfile-[0-9]*'])
# IMAGE
DEPS.add_dll(r'(lib)?jpeg[-0-9]*\.dll$', 'jpeg', ['*jpeg-[0-9]*'])
DEPS.add_dll(r'(png|libpng)[-0-9]*\.dll$', 'png', ['libpng-[1-9].*'], ['z'])
DEPS.add_dll(r'(lib){0,1}tiff[-0-9]*\.dll$', 'tiff', ['tiff-[0-9]*'], ['jpeg', 'z'])
DEPS.add_dll(r'(z|zlib1)\.dll$', 'z', ['zlib-[1-9].*'])
DEPS.add_dll(r'(lib)?webp[-0-9]*\.dll$', 'webp', ['*webp-[0-9]*'])
DEPS.add_dll(r'(lib)?webpdemux[-0-9]*\.dll$', 'webpdemux', ['*webpdemux-[0-9]*'])


def setup():
DEPS = DependencyGroup()
Expand All @@ -376,10 +380,6 @@ def setup():
DEPS.add_placeholder('PORTTIME')
DEPS.add('MIXER', 'SDL2_mixer', ['SDL2_mixer-[1-9].*'], r'(lib){0,1}SDL2_mixer\.dll$',
['SDL'])
DEPS.add('PNG', 'png', ['SDL2_image-[2-9].*', 'libpng-[1-9].*'], r'(png|libpng)[-0-9]*\.dll$', ['z'],
find_header=r'png\.h', find_lib=r'(lib)?png1[-0-9]*\.lib')
DEPS.add('JPEG', 'jpeg', ['SDL2_image-[2-9].*', 'jpeg-9*'], r'(lib){0,1}jpeg-9\.dll$',
find_header=r'jpeglib\.h', find_lib=r'(lib)?jpeg-9\.lib')
DEPS.add('IMAGE', 'SDL2_image', ['SDL2_image-[1-9].*'], r'(lib){0,1}SDL2_image\.dll$',
['SDL', 'jpeg', 'png', 'tiff'], 0)
DEPS.add('FONT', 'SDL2_ttf', ['SDL2_ttf-[2-9].*'], r'(lib){0,1}SDL2_ttf\.dll$', ['SDL', 'z', 'freetype'])
Expand Down Expand Up @@ -421,23 +421,13 @@ def setup_prebuilt_sdl2(prebuilt_dir):
DEPS.add('FREETYPE', 'freetype', ['freetype'], r'freetype[-0-9]*\.dll$',
find_header=r'ft2build\.h', find_lib=r'freetype[-0-9]*\.lib')

png = DEPS.add('PNG', 'png', ['SDL2_image-[2-9].*', 'libpng-[1-9].*'], r'(png|libpng)[-0-9]*\.dll$', ['z'],
find_header=r'png\.h', find_lib=r'(lib)?png1[-0-9]*\.lib')
png.path = imageDep.path
png.inc_dir = [os.path.join(prebuilt_dir, 'include').replace('\\', '/')]
png.found = True
jpeg = DEPS.add('JPEG', 'jpeg', ['SDL2_image-[2-9].*', 'jpeg-9*'], r'(lib){0,1}jpeg-9\.dll$',
find_header=r'jpeglib\.h', find_lib=r'(lib)?jpeg-9\.lib')
jpeg.path = imageDep.path
jpeg.inc_dir = [os.path.join(prebuilt_dir, 'include').replace('\\', '/')]
jpeg.found = True

dllPaths = {
'png': imageDep.path,
'jpeg': imageDep.path,
'tiff': imageDep.path,
'z': imageDep.path,
'webp': imageDep.path,
'webpdemux': imageDep.path,

'ogg': mixerDep.path,
'modplug': mixerDep.path,
Expand Down
8 changes: 4 additions & 4 deletions buildconfig/download_win_prebuilt.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ def get_urls(x86=True, x64=True):
'7469e9ea44d30a48b0510328cd94b25596e0aa0f',
],
[
'https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.5-VC.zip',
'137f86474691f4e12e76e07d58d5920c8d844d5b',
'https://github.com/pygame-community/SDL_image/releases/download/2.8.0-pgce/SDL2_image-devel-2.8.0-VCpgce.zip',
'da6b6a18f1c53baa775394e769059404925e98d7'
],
[
'https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.20.2/SDL2_ttf-devel-2.20.2-VC.zip',
Expand Down Expand Up @@ -201,12 +201,12 @@ def copy(src, dst):
copy(
os.path.join(
temp_dir,
'SDL2_image-devel-2.0.5-VC/SDL2_image-2.0.5'
'SDL2_image-devel-2.8.0-VCpgce/SDL2_image-2.8.0'
),
os.path.join(
move_to_dir,
prebuilt_dir,
'SDL2_image-2.0.5'
'SDL2_image-2.8.0'
)
)
copy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ sha512sum -c webp.sha512
tar xzf ${WEBP}.tar.gz
cd $WEBP

./configure $PG_BASE_CONFIGURE_FLAGS
./configure --enable-libwebpdemux $PG_BASE_CONFIGURE_FLAGS
make
make install
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e -x
cd $(dirname `readlink -f "$0"`)

SDL2="SDL2-2.28.5"
IMG2="SDL2_image-2.0.5"
IMG2="SDL2_image-2.8.0"
TTF2="SDL2_ttf-2.20.2"
MIX2="SDL2_mixer-2.6.3"

Expand Down Expand Up @@ -56,9 +56,17 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then
export SDL_IMAGE_CONFIGURE=--disable-imageio
fi

./configure --enable-png --disable-png-shared --enable-jpg --disable-jpg-shared \
--enable-tif --disable-tif-shared --enable-webp --disable-webp-shared \
$SDL_IMAGE_CONFIGURE $PG_BASE_CONFIGURE_FLAGS
# We prefer libpng and libjpeg-turbo over stb-image at the moment
# We also don't compile avif and jxl support at the moment
./configure $ARCHS_CONFIG_FLAG \
--disable-stb-image \
--disable-avif --disable-avif-shared \
--disable-jxl --disable-jxl-shared \
--enable-png --disable-png-shared \
--enable-jpg --disable-jpg-shared \
--enable-tif --disable-tif-shared \
--enable-webp --disable-webp-shared \
$SDL_IMAGE_CONFIGURE $PG_BASE_CONFIGURE_FLAGS
make
make install

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
12593eb78fcca877a8dfb78cf21a4e6feba7dc87c964de378ac462b36d8e41ecb587222cb41d5f56dd35b838e1b9867b8ae0cf2f4d2a01afaf23ac8c11edc84d SDL2-2.28.5.tar.gz
77e743d3f32707e015b290c1379ae3c7d7a3fe265995713267f0d0ec6517de4808f0de9890b5ab28445941af5bc9fbff346620629e0d7d7e9f365262cab05ee7 SDL2_image-2.0.5.tar.gz
b58eb45e5d80a4467ca58672dd74ccf99cc84b9546ad5a3b6fca8caa4cd81351e611eef8aa98e5592f21d326358afe120a9b89e747274d7efa5f5e2c39504ff6 SDL2_image-2.8.0.tar.gz
2e9da045d2fdab97236c3901b3d441834a67a47c8851ddfb817c9db6f23ed9fb355a5ef8d2158d0c9959a83934e8cd1b95db8a69eaddf8f7fcca115f01818740 SDL2_mixer-2.6.3.tar.gz
b54e93b100712e3764cd80d4e4b16cd4c2a6853620f675941a4214320b0ee29a583d57ad56cd5fdb5c7a32d7615cbf43bc3fa55337b01623cee7219ebb43667c SDL2_ttf-2.20.2.tar.gz
4 changes: 4 additions & 0 deletions docs/reST/ref/image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ formats.

* ``PNM``

* ``QOI``

* ``SVG`` (limited support, using Nano SVG)

* ``TGA`` (uncompressed)
ankith26 marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -48,6 +50,8 @@ formats.

.. versionaddedold:: 2.0 Loading SVG, WebP, PNM

.. versionadded:: 2.4.0 Loading QOI (Relies on SDL_Image 2.6.0+)

Saving images only supports a limited set of formats. You can save to the
following formats.

Expand Down
Binary file added examples/data/purple.qoi
Binary file not shown.
Loading
Loading