@@ -12,7 +12,7 @@ REBOL [
12
12
]
13
13
14
14
if find codecs 'png [
15
- extend codecs/png 'size? func ["Return PNG image size or none" bin [binary! ]][
15
+ put codecs/png 'size? func ["Return PNG image size or none" bin [binary! ]][
16
16
if all [
17
17
parse bin [
18
18
#{ 89504E470D0A1A0A } ;- PNG magic number
@@ -25,7 +25,7 @@ if find codecs 'png [
25
25
]
26
26
]
27
27
28
- extend codecs/png 'chunks function [
28
+ put codecs/png 'chunks function [
29
29
"Decode PNG into block of chunks (or encode back to binary from a block)"
30
30
data [binary! file! url! block! ] "Input data"
31
31
/only tags [block! ]
@@ -116,7 +116,7 @@ if find codecs 'png [
116
116
]
117
117
118
118
if find codecs 'jpeg [
119
- extend codecs/jpeg 'size? function ["Return JPEG image size or none" img [file! url! binary! ]][
119
+ put codecs/jpeg 'size? function ["Return JPEG image size or none" img [file! url! binary! ]][
120
120
unless binary? img [img: read /binary img]
121
121
unless img: find/tail img #{ FFD8 } [return none]
122
122
while [2 <= length? img][
@@ -149,7 +149,7 @@ if find codecs 'jpeg [
149
149
150
150
151
151
if find codecs 'gif [
152
- extend codecs/gif 'size? function ["Return GIF image size or none" img [file! url! binary! ]][
152
+ put codecs/gif 'size? function ["Return GIF image size or none" img [file! url! binary! ]][
153
153
unless binary? img [img: read /binary/part img 16 ]
154
154
parse img [
155
155
["GIF87a" | "GIF89a" ] img: (
@@ -161,7 +161,7 @@ if find codecs 'gif [
161
161
]
162
162
163
163
if find codecs 'bmp [
164
- extend codecs/bmp 'size? function ["Return BMP image size or none" img [file! url! binary! ]][
164
+ put codecs/bmp 'size? function ["Return BMP image size or none" img [file! url! binary! ]][
165
165
unless binary? img [img: read /binary/part img 32 ]
166
166
unless find/match img #{ 424D } [return none]
167
167
try [return to pair! binary/read img [SKIP 18 UI32LE UI32LE]]
@@ -170,7 +170,7 @@ if find codecs 'bmp [
170
170
]
171
171
172
172
if find codecs 'dds [
173
- extend codecs/dds 'size? function ["Return DDS image size or none" img [file! url! binary! ]][
173
+ put codecs/dds 'size? function ["Return DDS image size or none" img [file! url! binary! ]][
174
174
unless binary? img [img: read /binary/part img 32 ]
175
175
unless find/match img #{ 444453207C000000 } [return none]
176
176
try [return to pair! reverse binary/read img [SKIP 12 UI32LE UI32LE]]
@@ -179,7 +179,7 @@ if find codecs 'dds [
179
179
]
180
180
181
181
if find codecs 'qoi [
182
- extend codecs/qoi 'size? function ["Return QOI image size or none" img [file! url! binary! ]][
182
+ put codecs/qoi 'size? function ["Return QOI image size or none" img [file! url! binary! ]][
183
183
unless binary? img [img: read /binary/part img 32 ]
184
184
unless find/match img #{ 716F6966 } [return none]
185
185
try [return to pair! binary/read img [SKIP 4 UI32BE UI32BE]]
0 commit comments