I have tried with different files, including one that I created in Photoshop "from scratch", so I don't think it is an issue with the files. It also fails with PNG.
My suspicion is that this commit created the problem: https://github.com/OpenImageIO/oiio/commit/7677d498b599295fa8277d050ef994efbd297b55 The one before works fine and here the reading of jpg and png got changed. Note that reading a tif works fine. Unfortunately I don't understand the code well enough to be able to suggest a fix. Adding a std::cout to JpgInput::valid_file in jpeginput.cpp shows me that the function returns true, meaning that the magic number was actually correct. Why it fails afterwards, I have no idea. Am Sa., 20. Apr. 2019 um 18:26 Uhr schrieb Larry Gritz <[email protected]>: > I'm not quite sure I consider this closed. If it works with 2.0 and fails > in master consistently, that makes it seem like we have introduced a bug > and we need to fix (certainly before master becomes the new release some > months from now). > > That error message looks suspicious: Not a JPEG file: starts with 0xff > 0xe1 > > That's not the magic number for JPEG, so I'm wondering if this is a > problem with the particular file. Can you send it to me? I'd like to > examine what's going on with it. > > -- lg > > > On Apr 17, 2019, at 11:29 AM, till dechent <[email protected]> wrote: > > I built version 2.0.6 now and the error is gone. > > When I was trying 2.0.7 the build went through but failed to create > OpenImageIO.dll and OpenImageIO_Util.dll. > > Here are the working 2.0.6 binaries, if anybody wants them: > https://github.com/ttddee/oiio-msvc2017 > > Thanks Larry! > > > > Am Mi., 17. Apr. 2019 um 16:17 Uhr schrieb Larry Gritz <[email protected] > >: > >> If you try building from tag Release-2.0.7, does that work? >> >> >> >> On Apr 17, 2019, at 3:33 AM, till dechent <[email protected]> wrote: >> >> Hi, >> >> I have been using OIIO on Linux and it has been working great. Thank you >> for making it! >> >> Now I am building my application on Windows and ran into a problem >> reading images. >> >> I built OIIO version 2.1 with MSVC2017 x64. >> >> Trying to read a JPG I get: >> >> Invalid image file "C:\Users\till\Desktop\azul.jpg": JPEG error: Not a >> JPEG file: starts with 0xff 0xe1 >> >> Reading a PNG gives me: >> libpng error: Not a PNG file >> Invalid image file "C:\Users\till\Desktop\azul.png": PNG read error: Not >> a PNG file >> >> Reading a TIF image works fine though. >> >> Here is my test code: >> >> shared_ptr<ImageBuf> inputImage (new ImageBuf()); >> >> inputImage->init_spec("C:\\Users\\till\\Desktop\\azul.jpg", 0, 0); >> >> bool ok = inputImage->read(0, 0, TypeDesc::FLOAT); >> >> if (!ok) >> >> { >> >> cout << "There was a problem reading the image." << endl; >> >> cout << inputImage->geterror() << endl; >> >> } >> >> else >> { >> >> cout << "Image read successfully." << endl; >> >> } >> >> I tried different images to make sure I am not using corrupt ones. >> >> Any idea what could be causing this or where I am going wrong? >> >> Here are the offending binaries: https://github.com/ttddee/oiio-msvc2017 >> >> Thank you! >> >> Till >> >> >> _______________________________________________ >> Oiio-dev mailing list >> [email protected] >> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org >> >> >> -- >> Larry Gritz >> [email protected] >> >> >> >> >> _______________________________________________ >> Oiio-dev mailing list >> [email protected] >> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org >> > _______________________________________________ > Oiio-dev mailing list > [email protected] > http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org > > > -- > Larry Gritz > [email protected] > > > > > _______________________________________________ > Oiio-dev mailing list > [email protected] > http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org >
_______________________________________________ Oiio-dev mailing list [email protected] http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
