Skip to content

Conversation

bjarthur
Copy link
Member

@bjarthur bjarthur commented Nov 22, 2016

fixes reading of 16-bit tiffs. previously it worked, but stored them as UFixed8 instead of UFixed16.

while at it, i also fixed some deprecations and removed some duplicated exports.

what i don't understand is why getimagechanneldepth was used previously, instead of getimagedepth. all tests pass locally so the switch appears not to have broken anything.

@bjarthur
Copy link
Member Author

the only test that failed was due to a load error for julia 0.5 on 32-bit windows. all other versions of julia on all other OSes passed. is there a way to trigger a re-test for just this one case?

ERROR: LoadError: LoadError: automatic download failed (error: 2148270085): http://www.galloway.me.uk/media/other/EXIF_Orientation_Samples.zip

@timholy
Copy link
Member

timholy commented Nov 22, 2016

I can restart the whole AppVeyor build, but I don't think AppVeyor lets you restart just one platform.

Copy link
Member

@timholy timholy left a comment

Choose a reason for hiding this comment

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

Looks great overall. One small query.

T = UFixed8 # always use 8-bit for 8-bit and less
else
T = ufixedtype[2*((depth+1)>>1)] # always use an even # of bits (see issue 242#issuecomment-68845157)
T = UFixed{UInt16,((depth+1)>>1)<<1} # always use an even # of bits (see issue 242#issuecomment-68845157)
Copy link
Member

Choose a reason for hiding this comment

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

If ImageMagick ever supports images with more than 16 bits (does it now?), getting rid of the dictionary will make this harder to support. Any particular reason for hardcoding it here?

Copy link
Member Author

Choose a reason for hiding this comment

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

supporting >16-bit depths would be easier i think by changing the existing else clause to an elseif depth <= 16 and then adding logic for UFixed{UInt32,..} in a subsequent else clause. i figured we'd do that when the time came, but we could add that now if you want. i don't know whether ImageMagick currently supports it or not.

moreover, the dict uses notation that will be deprecated by JuliaMath/FixedPointNumbers.jl#51.

@bjarthur
Copy link
Member Author

this is what i had in mind re. 32-bit support. there's less hard-coding with this approach than having a dict.

the problem is that the 32-bit test is failing. the high 16 bits are the same in the saved and loaded versions, but not the low 16 bits. not sure whether it's on the julia side or ImageMagick's fault. i'm not hugely motivated to fix this as all i need is 16-bit support

@timholy
Copy link
Member

timholy commented Nov 22, 2016

Works for me. If that test is causing failures, I'd just say comment it out for now. Then hit merge whenever you feel ready.

@bjarthur
Copy link
Member Author

what version of imagemagick are you using @timholy ? we should document that it works for that version.

i've commented out the 32-bit test, added a comment to it explaining it fails for imagemagick 6.9.5, and added a warning to load_ for 32-bit images.

i don't have push access so i'll leave it to someone else to merge.

@timholy timholy merged commit 2d3a5d3 into JuliaIO:master Nov 23, 2016
@timholy
Copy link
Member

timholy commented Nov 23, 2016

Thanks!

@tkelman
Copy link
Contributor

tkelman commented Jan 29, 2017

Did you intend to comment out importimagepixels in the remaining exports list? Tagging this might be breaking if anyone was relying on that.

@tkelman
Copy link
Contributor

tkelman commented Jan 29, 2017

whoops nevermind, looks like the function implementation itself has always been commented out here too

@timholy
Copy link
Member

timholy commented Jan 29, 2017

Oh, noticed this:

what version of imagemagick are you using @timholy ? we should document that it works for that version.

6.8.9 on my laptop

@bjarthur bjarthur deleted the bja/16bit branch August 17, 2017 17:47
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.

3 participants