Skip to content

Commit

Permalink
FIX: Windows JPEG codec unexpected property type error
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Jan 29, 2024
1 parent 1c73cfe commit 307b24a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/os/win32/sys-codecs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ CODECS_API int DecodeImageFromFile(PCWSTR *uri, UINT frame, REBCDI *codi)
(LPCWSTR)uri
, NULL
, GENERIC_READ
, WICDecodeMetadataCacheOnLoad
, WICDecodeMetadataCacheOnDemand
, &pDecoder
);
ASSERT_HR("CreateDecoderFromFilename");
Expand Down Expand Up @@ -110,7 +110,7 @@ CODECS_API int DecodeImageFromFile(PCWSTR *uri, UINT frame, REBCDI *codi)
hr = pIWICFactory->CreateDecoderFromStream(
pStream
, NULL
, WICDecodeMetadataCacheOnLoad
, WICDecodeMetadataCacheOnDemand
, &pDecoder
);
ASSERT_HR("CreateDecoderFromStream");
Expand Down
Binary file added src/tests/units/files/issue-2587.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/tests/units/image-test.r3
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,15 @@ if value? 'blur [
#{0A00000A0A00000A0A00000A0A00000A} ;; premultiplied on macOS :/
] to binary! img2
]

if find codecs 'jpeg [
--test-- "loading JPEG file with an unexpected property type"
;@@ https://github.com/Oldes/Rebol-issues/issues/2587
--assert all [
img: image? try [load %units/files/issue-2587.jpg] ;; no error!
img/size = 105x150
]
]
===end-group===

===start-group=== "Image as a series"
Expand Down

0 comments on commit 307b24a

Please sign in to comment.