Skip to content

Commit

Permalink
racket/draw: support libjpeg v9
Browse files Browse the repository at this point in the history
Closes PR 13721
(cherry picked from commit 158997c)
  • Loading branch information
mflatt authored and rmculpepper committed Jul 22, 2013
1 parent a3a5a4e commit 0c3cd96
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions collects/racket/draw/unsafe/jpeg.rkt
Expand Up @@ -7,7 +7,7 @@
"../private/libs.rkt")

(define-runtime-lib jpeg-lib
[(unix) (ffi-lib "libjpeg" '("62" "8" ""))]
[(unix) (ffi-lib "libjpeg" '("62" "8" "9" ""))]
[(macosx)
;; for PPC, it's actually version 8!
(ffi-lib "libjpeg.62.dylib")]
Expand All @@ -24,6 +24,7 @@
(define _J_COLOR_SPACE _int)
(define _J_DCT_METHOD _int)
(define _J_DITHER_MODE _int)
(define _J_COLOR_TRANSFORM _int)

(define _jbool (if win64?
(make-ctype _byte
Expand Down Expand Up @@ -96,7 +97,7 @@
(string->number (cadr m))
"unknown"))))))

(unless (member JPEG_LIB_VERSION '(62 64 70 80))
(unless (member JPEG_LIB_VERSION '(62 64 70 80 90))
(error 'jpeg "unsupported library version: ~e" JPEG_LIB_VERSION))

(define-syntax-rule (cstruct-type/version elem ...)
Expand Down Expand Up @@ -261,6 +262,9 @@
[saw_Adobe_marker _jbool]
[Adobe_transform _uint8]

,([(90) ([color_transform _J_COLOR_TRANSFORM])]
[else ()])

[CCIR601_sampling _jbool]

[marker_list _pointer]
Expand Down Expand Up @@ -470,6 +474,9 @@
[Y_density _uint16]
[write_Adobe_marker _jbool]

,([(90) ([color_transform _J_COLOR_TRANSFORM])]
[else ()])

[next_scanline _JDIMENSION]

[progressive_mode _jbool]
Expand Down

0 comments on commit 0c3cd96

Please sign in to comment.