File tree 3 files changed +22
-1
lines changed
3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -146,3 +146,16 @@ if find codecs 'jpeg [
146
146
none
147
147
]
148
148
]
149
+
150
+
151
+ if find codecs 'gif [
152
+ extend codecs/gif 'size? function ["Return GIF image size or none" img [file! url! binary! ]][
153
+ unless binary? img [img: read /binary/part img 16 ]
154
+ parse img [
155
+ ["GIF87a" | "GIF89a" ] img: (
156
+ return to pair! binary/read img [UI16LE UI16LE]
157
+ )
158
+ ]
159
+ none
160
+ ]
161
+ ]
Original file line number Diff line number Diff line change @@ -412,7 +412,15 @@ if find codecs 'JPEG [
412
412
--assert 256x256 = codecs/jpeg/size? %units/files/flower-tiny.jpg
413
413
--assert none? codecs/jpeg/size? %units/files/test.aar
414
414
===end-group===
415
- ]
415
+ ]
416
+
417
+ if find codecs 'GIF [
418
+ ===start-group=== "GIF codec"
419
+ --test-- "gif/size?"
420
+ --assert 256x256 = codecs/gif/size? %units/files/flower.gif
421
+ --assert none? codecs/gif/size? %units/files/test.aar
422
+ ===end-group===
423
+ ]
416
424
417
425
if find codecs 'XML [
418
426
===start-group=== "XML codec"
You can’t perform that action at this time.
0 commit comments