Skip to content
Open
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
5 changes: 3 additions & 2 deletions src/JPEGView/FileList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,10 @@ void CFileDesc::SetModificationDate(const FILETIME& lastModDate) {

// image file types supported internally (there are additional endings for RAW and WIC - these come from INI file)
// NOTE: when adding more supported filetypes, update installer to add another extension for "SupportedTypes"
static const int cnNumEndingsInternal = 17;
static const int cnNumEndingsInternal = 20;
static const TCHAR* csFileEndingsInternal[cnNumEndingsInternal] = {_T("jpg"), _T("jpeg"), _T("jfif"), _T("bmp"), _T("png"),
_T("tif"), _T("tiff"), _T("gif"), _T("webp"), _T("jxl"), _T("avif"), _T("heif"), _T("heic"), _T("tga"), _T("qoi"), _T("psd"), _T("psb") };
_T("tif"), _T("tiff"), _T("gif"), _T("webp"), _T("jxl"), _T("avif"), _T("heif"), _T("heic"), _T("tga"), _T("qoi"), _T("psd"), _T("psb"),
_T("ico"), _T("wmf"), _T("emf") };
// supported camera RAW formats
static const TCHAR* csFileEndingsRAW = _T("*.pef;*.dng;*.crw;*.nef;*.cr2;*.mrw;*.rw2;*.orf;*.x3f;*.arw;*.kdc;*.nrw;*.dcr;*.sr2;*.raf");

Expand Down
6 changes: 6 additions & 0 deletions src/JPEGView/ImageLoadThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ static EImageFormat GetImageFormat(LPCTSTR sFileName) {
return IF_QOI;
} else if (header[0] == '8' && header[1] == 'B' && header[2] == 'P' && header[3] == 'S') {
return IF_PSD;
} else if (header[0] == 0xd7 && header[1] == 0xcd && header[2] == 0xc6 && header[3] == 0x9a) {
return IF_WMF;
}

// default fallback if no matches based on magic bytes
Expand All @@ -95,6 +97,10 @@ static EImageFormat GetImageFormat(LPCTSTR sFileName) {
// ex: CR2 - http://lclevy.free.fr/cr2/#key_info
// ex: DNG - https://www.adobe.com/creativecloud/file-types/image/raw/dng-file.html#dng
return IF_TIFF;
} else if (header[0] == 0x00 && header[1] == 0x00 && header[2] == 0x01 && header[3] == 0x00) {
return IF_ICO;
} else if (header[0] == 0x01 && header[1] == 0x00 && header[2] == 0x00 && header[3] == 0x00) {
return IF_EMF;
}
return IF_Unknown;
}
Expand Down
3 changes: 3 additions & 0 deletions src/JPEGView/ImageProcessingTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ enum EImageFormat {
IF_AVIF,
IF_QOI,
IF_PSD,
IF_ICO,
IF_WMF,
IF_EMF,
IF_WIC,
IF_CLIPBOARD,
IF_CameraRAW,
Expand Down
Loading