Coder Social home page Coder Social logo

Comments (4)

KLuuKer avatar KLuuKer commented on May 12, 2024

it could also be a issue with the png itself, because if i resave the image with irfanview it multithread decodes & encodes correctly

overview

from imagesharp.

JimBobSquarePants avatar JimBobSquarePants commented on May 12, 2024

Hmmmm... Probably the ArrayPool stuff again. Odd, it really doesn't seem to be threadsafe.

Would you be able to fork the repo and conduct your tests with a reverted decoder? I'll test myself when I can.

from imagesharp.

KLuuKer avatar KLuuKer commented on May 12, 2024

Well i checked and the ArrayPool is definitely thread safe

BUT you will eventually get MORE bytes than you asked for. the docs say it will return a array of MINIMAL the specified length. so great care must be taken in using the bytes that are returned by the pool.

https://github.com/JimBobSquarePants/ImageSharp/blob/master/src/ImageSharp/Formats/Png/PngDecoderCore.cs#L338
i replaced those pool rent's with new byte[this.bytesPerScanline];
and that worked, so the issue would probably be in the processing of
https://github.com/JimBobSquarePants/ImageSharp/blob/master/src/ImageSharp/Formats/Png/PngDecoderCore.cs#L365
as that doesn't have the correct length passed to it

sorry if it sounds like i'm ranting, it must be hard trying to keep your head straight with this huge amount of code

from imagesharp.

JimBobSquarePants avatar JimBobSquarePants commented on May 12, 2024

Och not at all, at least it looks like it should be an easy fix then. Would you like to give it a go? You have the advantage of tests that work.

I really need to beef up my parallel test.

from imagesharp.

Related Issues (20)

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.