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

Use SDL_image image saving routines (3083) #1562

Closed
2 tasks done
GalacticEmperor1 opened this issue Feb 12, 2023 · 1 comment
Closed
2 tasks done

Use SDL_image image saving routines (3083) #1562

GalacticEmperor1 opened this issue Feb 12, 2023 · 1 comment
Labels
Code quality/robustness Code quality and resilience to changes image pygame.image

Comments

@GalacticEmperor1
Copy link
Collaborator

GalacticEmperor1 commented Feb 12, 2023

Issue №3083 opened by Starbuck5 at 2022-03-17 06:38:23

In pygame.imageext, we have custom PNG and JPEG saving routines.

SDL_image has routines for this, and it would be advantageous to use them. It would reduce our code footprint, maintenance burden, and mean we don't have to provide png and jpeg lib headers in our build system.

According to their changelog IMG_SavePNG is new in SDL_image 2.0.0 and IMG_SaveJPG is new in 2.0.2. I'd be okay raising our minimum supported SDL_image to 2.0.2 (as stated in the README) to support that all the time.

And imageext already uses IMG_SaveJPG if it can. It's also worth noting that @ThanhChinhBK just made our custom PNG saver support 8 bit surfaces in pygame/pygame#3028. I believe the IMG_SavePNG function will support that out of the box but the contributed test will be handy to verify that.

Tasks:

  • Investigate removing custom jpeg saver and using IMG_SaveJPG all the time
  • Investigate using IMG_SavePNG

Comments

# # FierceJDM commented at 2022-04-09 09:34:57

@Starbuck5 Shall i open a pull request and add the changes to it ? Not very sure on how i should proceed

@GalacticEmperor1 GalacticEmperor1 added C code Code quality/robustness Code quality and resilience to changes image pygame.image labels Feb 12, 2023
@ankith26
Copy link
Member

This has been fixed in #2596

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code quality/robustness Code quality and resilience to changes image pygame.image
Projects
None yet
Development

No branches or pull requests

3 participants