Skip to content
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

fix tiff support #414

Merged
merged 5 commits into from
Jul 23, 2018
Merged

fix tiff support #414

merged 5 commits into from
Jul 23, 2018

Conversation

jdexyz
Copy link

@jdexyz jdexyz commented Mar 2, 2018

Tiff support seems broken in the current version (f7b5e5b).
Code in this PR is tested and working.
npm test shows a lot of lint errors, but the style of the modification is in line with the existing code.
(Please be kind, it is my first pull request!)

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good well done

Copy link
Collaborator

@hipstersmoothie hipstersmoothie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the test now pass for you? @jeremypatrickdahan

index.js Outdated
var tiff = (UTIF.decode(data)[0]);
var ifds = UTIF.decode(data)
var page = ifds[0];
UTIF.decodeImages(data, ifds);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this line actually doing anything?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it modifies ifds in place.
I need to re-check this

@hipstersmoothie
Copy link
Collaborator

I tested it out and it does in fact work. @jeremypatrickdahan can you update the TIFF test so it passes? I will merge once you do.

@jdexyz
Copy link
Author

jdexyz commented Jul 22, 2018

Ok, the original tiff image in the samples directory had strange values in the test (pixels coordinates outside of the image). I changed it to one from http://www.petitcolas.net/watermarking/image_database/ and changed the values accordingly, double checking the values manually in Photoshop.

The line UTIF.decodeImages(data, ifds); uses a function of utif.js only available in version 2.0.0, so I updated the package.json. All tests now pass.

@hipstersmoothie
Copy link
Collaborator

Sweet! can you regenerate the lock file? Don't manually resolve the merge conflicts. You can just delete it and re-install.

@hipstersmoothie
Copy link
Collaborator

@jeremypatrickdahan Big changes happened in the repo! to resolve your merge conflicts I would:

  • remove package-lock.json and run yarn to add the new dep to the lock file
  • regenerate the browser/lib/*.js files

Thanks for your work!

@jdexyz
Copy link
Author

jdexyz commented Jul 23, 2018

I'm a bit confused... I did run yarn but the resulting lockfile a syntax different from the npm one.
It did regenerate the browser/lib/*.js files, although I am not sure it did it correctly ...
I'm sorry, I realise I am making this merge a bit lengthy

@hipstersmoothie hipstersmoothie merged commit 9452394 into jimp-dev:master Jul 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants