Skip to content

Commit 307b24a

Browse files
committed
FIX: Windows JPEG codec unexpected property type error
resolves: Oldes/Rebol-issues#2587
1 parent 1c73cfe commit 307b24a

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

src/os/win32/sys-codecs.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ CODECS_API int DecodeImageFromFile(PCWSTR *uri, UINT frame, REBCDI *codi)
8080
(LPCWSTR)uri
8181
, NULL
8282
, GENERIC_READ
83-
, WICDecodeMetadataCacheOnLoad
83+
, WICDecodeMetadataCacheOnDemand
8484
, &pDecoder
8585
);
8686
ASSERT_HR("CreateDecoderFromFilename");
@@ -110,7 +110,7 @@ CODECS_API int DecodeImageFromFile(PCWSTR *uri, UINT frame, REBCDI *codi)
110110
hr = pIWICFactory->CreateDecoderFromStream(
111111
pStream
112112
, NULL
113-
, WICDecodeMetadataCacheOnLoad
113+
, WICDecodeMetadataCacheOnDemand
114114
, &pDecoder
115115
);
116116
ASSERT_HR("CreateDecoderFromStream");

src/tests/units/files/issue-2587.jpg

9.6 KB
Loading

src/tests/units/image-test.r3

+9
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,15 @@ if value? 'blur [
488488
#{0A00000A0A00000A0A00000A0A00000A} ;; premultiplied on macOS :/
489489
] to binary! img2
490490
]
491+
492+
if find codecs 'jpeg [
493+
--test-- "loading JPEG file with an unexpected property type"
494+
;@@ https://github.com/Oldes/Rebol-issues/issues/2587
495+
--assert all [
496+
img: image? try [load %units/files/issue-2587.jpg] ;; no error!
497+
img/size = 105x150
498+
]
499+
]
491500
===end-group===
492501

493502
===start-group=== "Image as a series"

0 commit comments

Comments
 (0)