mirror of
https://github.com/hyprwm/hyprpaper.git
synced 2024-11-16 22:25:59 +01:00
feat: be case-insensitive about suffixes. (#44)
Unfortunately many cameras/mobiles still use ALL_CAPS.
This commit is contained in:
parent
83867464c5
commit
61961973cf
1 changed files with 3 additions and 2 deletions
|
@ -10,9 +10,10 @@ void CWallpaperTarget::create(const std::string& path) {
|
|||
const auto BEGINLOAD = std::chrono::system_clock::now();
|
||||
|
||||
cairo_surface_t* CAIROSURFACE = nullptr;
|
||||
if (path.find(".png") == path.length() - 4) {
|
||||
const auto len = path.length();
|
||||
if (path.find(".png") == len - 4 || path.find(".PNG") == len - 4) {
|
||||
CAIROSURFACE = cairo_image_surface_create_from_png(path.c_str());
|
||||
} else if (path.find(".jpg") == path.length() - 4 || path.find(".jpeg") == path.length() - 5) {
|
||||
} else if (path.find(".jpg") == len - 4 || path.find(".JPG") == len - 4 || path.find(".jpeg") == len - 5 || path.find(".JPEG") == len - 5) {
|
||||
CAIROSURFACE = JPEG::createSurfaceFromJPEG(path);
|
||||
m_bHasAlpha = false;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue