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

[OpenImageIO] Jpeg2000 support #23562

Closed
ttddee opened this issue Mar 15, 2022 · 8 comments · Fixed by #23812
Closed

[OpenImageIO] Jpeg2000 support #23562

ttddee opened this issue Mar 15, 2022 · 8 comments · Fixed by #23812
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@ttddee
Copy link

ttddee commented Mar 15, 2022


I am trying to install OpenImageIO version 2.3.10.1 on Windows with support for Jpeg2000.

In my understanding, adding the feature-flag openjpeg should enable this?

The entry in my manifest file looks like this:

"dependencies": [
    {
	  "name": "openimageio",
          "default-features": false,
	  "features": [ "gif", "libraw", "opencolorio", "openjpeg" ]
    },
	...
  ],
  "builtin-baseline": "0d0547a3d816b5092abece5abbdc85d23c88d9c9",
  "overrides": [
	{ "name": "openimageio", "version": "2.3.10.1" }
  ]

This does install the openjpeg dependency but when I use the OpenImageIO version and query the extensions, like this

OIIO::get_string_attribute ("extension_list");

I get the following:

bmp:bmp,dib;cineon:cin;dds:dds;dpx:dpx;fits:fits;gif:gif;hdr:hdr,rgbe;iff:iff,z;jpeg:jpg,jpe,jpeg,jif,jfif,jfi;null:null,nul;openexr:exr,sxr,mxr;png:png;pnm:ppm,pgm,pbm,pnm,pfm;psd:psd,pdd,psb;raw:bay,bmq,cr2,crw,cs1,dc2,dcr,dng,erf,fff,k25,kdc,mdc,mos,mrw,nef,orf,pef,pxn,raf,raw,rdc,sr2,srf,x3f,arw,3fr,cine,ia,kc2,mef,nrw,qtk,rw2,sti,rwl,srw,drf,dsc,ptx,cap,iiq,rwz,cr3;rla:rla;sgi:sgi,rgb,rgba,bw,int,inta;socket:socket;softimage:pic;tiff:tif,tiff,tx,env,sm,vsm;targa:tga,tpic;term:term;zfile:zfile

There is no .jp2 listed. Interestingly there is the entry null:null,nul in the place where .jp2 should probably show up.

Is this the right way to add Jpeg2000 support or am I missing something?

@JackBoosY JackBoosY added the category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist label Mar 17, 2022
@JackBoosY JackBoosY assigned Adela0814 and unassigned JackBoosY Mar 17, 2022
@Adela0814 Adela0814 added category:port-bug The issue is with a library, which is something the port should already support and removed category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist labels Mar 25, 2022
@Adela0814
Copy link
Contributor

This usage is correct, this issue is OpenJPEG can't be found, I will fix it soon.

@ttddee
Copy link
Author

ttddee commented Mar 30, 2022

Sorry it doesn't seem to work for me. I did a git pull, deleted the vcpkg_installed directory and changed my manifest to this:

"dependencies": [
    {
	  "name": "openimageio",
          "default-features": false,
	  "features": [ "gif", "libraw", "opencolorio", "openjpeg" ]
    },
	...
  ],
  "builtin-baseline": "7f8d1606176ddbbacdee868eefa11c95dcdb4a82",
  "overrides": [
	{ "name": "openimageio", "version": "2.3.10.1" }
  ]

OIIO::get_string_attribute ("extension_list") looks like this:

bmp:bmp,dib;cineon:cin;dds:dds;dpx:dpx;fits:fits;gif:gif;hdr:hdr,rgbe;iff:iff,z;jpeg:jpg,jpe,jpeg,jif,jfif,jfi;null:null,nul;openexr:exr,sxr,mxr;png:png;pnm:ppm,pgm,pbm,pnm,pfm;psd:psd,pdd,psb;raw:bay,bmq,cr2,crw,cs1,dc2,dcr,dng,erf,fff,k25,kdc,mdc,mos,mrw,nef,orf,pef,pxn,raf,raw,rdc,sr2,srf,x3f,arw,3fr,cine,ia,kc2,mef,nrw,qtk,rw2,sti,rwl,srw,drf,dsc,ptx,cap,iiq,rwz,cr3;rla:rla;sgi:sgi,rgb,rgba,bw,int,inta;socket:socket;softimage:pic;tiff:tif,tiff,tx,env,sm,vsm;targa:tga,tpic;term:term;zfile:zfile

@Adela0814
Copy link
Contributor

please remove openimageio and openjpeg via vcpkg remove **, then clean up your buildtree directory and try again.

@ttddee
Copy link
Author

ttddee commented Mar 31, 2022

I have deleted the whole vcpkg installation and reinstalled with the above manifest, like so:

git clone https://github.com/microsoft/vcpkg

.\vcpkg\bootstrap-vcpkg.bat

.\vcpkg\vcpkg --feature-flags="versions" --triplet=x64-windows  install

The result is the same.

I just built OpenImageIO on Win10 myself to see what the problem might be.

In CMake I had to manually specify the following variables for it to build correctly with openjpeg:

USE_OPENJPG=1
OPENJPEG_INCLUDE_DIR=<path>
OPENJPEG_OPENJP2_LIBRARY_DEBUG=<path>
OPENJPEG_OPENJP2_LIBRARY_RELEASE=<path>
OPENJPEG_OPENJPEG_LIBRARY_DEBUG=<path>
OPENJPEG_OPENJPEG_LIBRARY_RELEASE=<path>

When I query extension_list now I get:

bmp:bmp,dib;cineon:cin;dds:dds;dpx:dpx;fits:fits;hdr:hdr,rgbe;iff:iff,z;jpeg:jpg,jpe,jpeg,jif,jfif,jfi;jpeg2000:jp2,j2k,j2c;null:null,nul;openexr:exr,sxr,mxr;pnm:ppm,pgm,pbm,pnm,pfm;psd:psd,pdd,psb;rla:rla;sgi:sgi,rgb,rgba,bw,int,inta;socket:socket;softimage:pic;tiff:tif,tiff,tx,env,sm,vsm;targa:tga,tpic;term:term;zfile:zfile

Note the jpeg2000 entry.

@Adela0814
Copy link
Contributor

Adela0814 commented Apr 1, 2022

You should add the openjpeg feature to turn on the option when you install openimageio.
please change .\vcpkg\vcpkg --feature-flags="versions" --triplet=x64-windows install to .\vcpkg install openimageio[openjpeg]:x64-windows

@dg0yt
Copy link
Contributor

dg0yt commented Apr 1, 2022

You should add the openjpeg feature to turn on the option when you install openimageio. please change .\vcpkg\vcpkg --feature-flags="versions" --triplet=x64-windows install to .\vcpkg install openimageio[openjpeg]:x64-windows

No, this won't help. #23812 changed the config lookup, but ignored different spelling of variables.

@dg0yt
Copy link
Contributor

dg0yt commented Apr 1, 2022

I will create a PR.

@dg0yt
Copy link
Contributor

dg0yt commented Apr 1, 2022

ignored different spelling of variables.

This part of my statement was wrong. I will still create a PR with changes. In particular, we need matching find_dependency in the exported cmake config when a target is used in linking (and openjp2 is a target name). There are more warnings in the log which are concerning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants