IMG_SaveJPG(3)

πŸ’– NAME πŸ’–

okay so bestie, welcome to the IMG_SaveJPG(3) page, part of SDL_image3 FUNCTIONS ✨ β€” this one is all about saving an SDL_Surface into a JPEG image file. iconic behavior, honestly πŸŽ€


✨ SYNOPSIS ✨

#include <SDL3_image/SDL_image.h>

bool IMG_SaveJPG(SDL_Surface *surface, const char *file, int quality);

🌸 DESCRIPTION 🌸

if the file already exists, it will be overwritten. no cap. so yeah, bestie, keep that in mind before you point it at something precious 😭


πŸ¦‹ FUNCTION PARAMETERS πŸ¦‹

  • surface β€” the SDL_Surface you want to save. that's the main character right there πŸ’…
  • file β€” path on the filesystem to write new file to. yes, the actual destination vibe check πŸ“
  • quality β€” the quality bands are: [0; 33] is Lowest quality, [34; 66] is Middle quality, [67; 100] is Highest quality. pick your fighter 🌈

🫢 RETURN VALUE 🫢

Returns true on success or false on failure; call SDL_GetError() for more information. so if it goes wrong, don't just spiral β€” go ask SDL_GetError() what happened πŸ”₯


⭐ AVAILABILITY ⭐

This function is available since SDL_image 3.0.0. periodt πŸ‘‘


🧚 SEE ALSO 🧚


mwah πŸ’‹ that's the whole page, brought to you by SDL_image, version 3.4.4 β€” go save some JPEGs, bestie πŸ“πŸ’œ

πŸ“¦ where this page comes from