Add PSD support

This commit is contained in:
Joel16 2020-07-10 16:32:02 -04:00
parent a0d2ac847a
commit 1eb1d7727b
3 changed files with 5 additions and 3 deletions

View File

@ -11,6 +11,7 @@ A simple homebrew file browser that is used for viewing various image formats on
- PCX
- PNG
- PGM/PPM
- PSD
- TGA
- TIFF
- WEBP

View File

@ -142,7 +142,8 @@ namespace GUI {
std::string ext = FS::GetFileExt(filename);
if ((ext == ".BMP") || (ext == ".GIF") || (ext == ".ICO") || (ext == ".JPG") || (ext == ".JPEG") || (ext == ".PCX")
|| (ext == ".PNG") || (ext == ".PGM") || (ext == ".PPM") || (ext == ".TGA") || (ext == ".TIFF") || (ext == ".WEBP"))
|| (ext == ".PNG") || (ext == ".PGM") || (ext == ".PPM") || (ext == ".PSD") || (ext == ".TGA") || (ext == ".TIFF")
|| (ext == ".WEBP"))
ImGui::Image((void *)(intptr_t)image_texture.id, ImVec2(image_texture.width, image_texture.height));
else
ImGui::Image((void *)(intptr_t)file_texture.id, ImVec2(file_texture.width, file_texture.height));
@ -169,7 +170,7 @@ namespace GUI {
gui_state = GUI_STATE_IMAGE_PREVIEW;
}
else if ((ext == ".JPG") || (ext == ".JPEG") || (ext == ".PNG") || (ext == ".PGM") || (ext == ".PPM")
|| (ext == ".TGA")) {
|| (ext == ".PSD") || (ext == ".TGA")) {
SceBool image_ret = Textures::LoadImageFile(path, &texture);
IM_ASSERT(image_ret);
gui_state = GUI_STATE_IMAGE_PREVIEW;

View File

@ -16,10 +16,10 @@
#define STBI_NO_GIF
#define STBI_NO_HDR
#define STBI_NO_PIC
#define STBI_NO_PSD
#define STBI_ONLY_JPEG
#define STBI_ONLY_PNG
#define STBI_ONLY_PNM
#define STBI_ONLY_PSD
#define STBI_ONLY_TGA
#include "stb_image.h"