Git Product home page Git Product logo

Comments (6)

cocoa-xu avatar cocoa-xu commented on July 21, 2024 1

Hi @ChristopheBelpaire, thanks for reporting this issue. I'll try to fix this issue sometime this week!

from stb_image.

ChristopheBelpaire avatar ChristopheBelpaire commented on July 21, 2024

Ok, the problem comes from the way I'm loading the images StbImage.read_file(path, channels: 3)
Some of my images seems to have 4 channels, the crash seems to be caused by the fact the load is forced to 3 channel for a 4 channel image.

from stb_image.

cocoa-xu avatar cocoa-xu commented on July 21, 2024
$ file /Users/cocoa/Downloads/archive/PetImages/Cat/10404.jpg
/Users/cocoa/Downloads/archive/PetImages/Cat/10404.jpg: Adobe Photoshop Image, 432 x 363, RGB, 3x 8-bit channels

I found one in the dataset that can cause this issue, but it's definitely not a JPEG image and seems to have wrong metadata perhaps. I'll look into this further

from stb_image.

ChristopheBelpaire avatar ChristopheBelpaire commented on July 21, 2024

Awesome, thanks!

I removed the "bad" images with :

    |> Stream.filter(fn
       {:ok, {%StbImage{shape: {_, _, 3}}, _}} -> true
       _ -> false end)

To filter the channel, everything can be loaded with this filter.

from stb_image.

cocoa-xu avatar cocoa-xu commented on July 21, 2024

Hi @ChristopheBelpaire, v0.6.6 is out and should fix this issue!

from stb_image.

ChristopheBelpaire avatar ChristopheBelpaire commented on July 21, 2024

Awesome!
I tried my scenario again and it seems to load all the images.
Thanks for the fix!

from stb_image.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.