-
Notifications
You must be signed in to change notification settings - Fork 1.2k
windows jpeg support #841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
windows jpeg support #841
Conversation
Any update on this one? Can it be merged? |
👍 Looks good. Builds and tests pass on Win 10, VC2015, libjpeg-turbo-1.5.1 x64. |
Awesome 👍 Should this be backported to 1.x also? (I can fix it) Hopefully I'll get some time this week to merge a few of the ready PRs, including this :) |
It's non-breaking, so seems suited to 1.x, yes. Thanks! |
(I used libjpeg-turbo-1.5.1-vc64.exe 2016-09-21 from your link, which has bin/libjpeg62.dll) |
@@ -880,7 +880,11 @@ cairo_status_t | |||
Image::loadJPEG(FILE *stream) { | |||
cairo_status_t status; | |||
|
|||
#if defined(_MSC_VER) | |||
if (false) { // Force using loadJPEGFromBuffer | |||
#else | |||
if (data_mode == DATA_IMAGE) { // Can lazily read in the JPEG. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not put the #if defined(_MSC_VER)
inside of this this if-statment and avoid if (false) {
and duplicating if (data_mode == DATA_IMAGE) {
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LinusU To prevent repeating the buffer reading stuff https://github.com/Automattic/node-canvas/blob/master/src/Image.cc#L901-L911
Can of course refactor if you wish. Let me know.
Sorry for the delay on this, merging now 👍 |
@LinusU Great! Thanks. |
Cleaned up replacement for PR #815