Skip to content

Commit

Permalink
fix thumbnail case
Browse files Browse the repository at this point in the history
  • Loading branch information
qbnu committed Jun 12, 2024
1 parent f571f15 commit 8392332
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/JPEGView/PSDWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ CJPEGImage* PsdReader::ReadImage(LPCTSTR strFileName, bool& bOutOfMemory)
unsigned short nResourceID = ReadUShortFromFile(hFile);

// Skip Pascal string (padded to be even length)
unsigned char nStringSize = ReadUCharFromFile(hFile) | 1;
SeekFile(hFile, nStringSize);
unsigned char nStringSize = ReadUCharFromFile(hFile);
SeekFile(hFile, nStringSize | 1);

// Resource size
unsigned int nResourceSize = ReadUIntFromFile(hFile);
Expand Down Expand Up @@ -438,7 +438,8 @@ CJPEGImage* PsdReader::ReadThumb(LPCTSTR strFileName, bool& bOutOfMemory)
unsigned short nResourceID = ReadUShortFromFile(hFile);

// Skip Pascal string (padded to be even length)
while (ReadUShortFromFile(hFile));
unsigned char nStringSize = ReadUCharFromFile(hFile);
SeekFile(hFile, nStringSize | 1);

// Resource size
unsigned int nResourceSize = ReadUIntFromFile(hFile);
Expand Down

0 comments on commit 8392332

Please sign in to comment.