uoregon-libraries / rais-image-server

RAIS: A IIIF-compliant, 100% open source image server for blazing-fast deep zooming
Creative Commons Zero v1.0 Universal
78 stars 6 forks source link

Seemingly a type mismatch in the return value of opjStreamRead #37

Closed hejob closed 3 years ago

hejob commented 3 years ago

In src/openjpeg/image_stream.go, the value returned by opjStreamRead is opjMinusOne64 (type OPJ_UINT64), which seemingly mismatches the return type OPJ_SIZE_T under some compiling systems.

The compilation fails in local golang environment under MacOS Catalina with brew module openjpeg installed and used as a library. The problem is fixed after changing return value to opjMinusOneSizeT.

I think the reason it goes well in docker environment (both alpine and golang) is maybe that the two types references to the same type in ibopenjp2-7-dev. But in my MacOS local environment, the two types confirmed are u_longlong and u_long respectively.

I have made a push request trying to fix this.

jechols commented 3 years ago

ARGH. Thanks for this, I'll take a look.

jechols commented 3 years ago

Your PR is merged and included in v4.0.2. Docker image is still pending, though that shouldn't matter since those were never affected to begin with.