Giter Site home page Giter Site logo

Comments (8)

hiiamboris avatar hiiamboris commented on May 28, 2024 1

I can.

>> load https://private-user-images.githubusercontent.com/16221143/305634607-f28c6104-e97a-4315-a6df-292ac14987bc.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDgxNjU5MDMsIm5iZiI6MTcwODE2NTYwMywicGF0aCI6Ii8xNjIyMTE0My8zMDU2MzQ2MDctZjI4YzYxMDQtZTk3YS00MzE1LWE2ZGYtMjkyYWMxNDk4N2JjLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAyMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwMjE3VDEwMjY0M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY0NGZmM2YyZmRjMWJmN2YwOTBiYzRiNTkyYmVlYjlmYTEwOWMwNmNkNzZhMTMxZTYwNTI1MmFhNzkwYWI5YTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.w0ZeJG5XjjuZjB-v3S2cZ3ec-N-M6MIhf7DrRsstPa4                                                                                                                                                                                                                                                                                                                    
*** Runtime Error 1: access violation
*** in file: /d/devel/red/red-src/master/runtime/platform/image-wic.reds
*** at line: 582
***
***   stack: red/OS-image/get-data 91390818 0109FD2Ch
***   stack: red/image/serialize 0527201Ch 0527202Ch false false false 0527202Ch 173 1
***   stack: red/image/mold 0527201Ch 0527202Ch false false false 0527202Ch 191 0
***   stack: red/actions/mold 0527201Ch 0527202Ch false false false 0527202Ch 191 0
***   stack: red/actions/mold* -1 -1 -1 1
***   stack: ctx||627~do-command 057DF680h
***   stack: ctx||627~eval-command 057DF680h
***   stack: ctx||627~run 057DF680h
***   stack: ctx||627~launch 057DF680h
***   stack: ctx||646~launch 057DF06Ch

from red.

qtxie avatar qtxie commented on May 28, 2024 1

Should be fixed by commit 151ab0c.

from red.

dockimbel avatar dockimbel commented on May 28, 2024

I have some troubles reading that file. Most of the time I get a network access error:

*** Access Error: cannot connect: https://private-user-images.githubusercontent.com/16221143/305634607-f28c6104-e9 
*** Where: read
*** Near : a: read/binary https://private-user-imag
*** Stack: 

from red.

dockimbel avatar dockimbel commented on May 28, 2024

I succeeded in downloading the corruped image and saving it locally. However, making it to crash requires:

mold load/as read/binary %bad.jpg 'jpeg

Using just load is not enough as it gets rightly rejected:

>> load/as %bad.jpg 'jpeg
*** Access Error: cannot open: %bad.jpg
*** Where: decode
*** Near : codec/decode source
*** Stack: load

while it passes when the input is a binary! series, but later causes a crash when trying to mold the resulting image! value.

from red.

dockimbel avatar dockimbel commented on May 28, 2024

There's still a problem: the invalid image is not triggering an error on load but only later, when the image is serialized by mold or form:

img: load/as read/binary %bad.jpg 'jpeg
probe set/any 'err try [mold img]

gives:

make error! [
    code: 513
    type: 'access
    id: 'bad-media
    arg1: none
    arg2: none
    arg3: none
    near: unset
    where: 'mold              ;-- should error out in `load` instead!
    stack: 90247320
]

@qtxie If there's no other way to check in image/decode if the image is valid or not, maybe we should add a call to lock-bitmap and unlock-bitmap at the end of the loading, to trigger the error there when the image is invalid?

from red.

qtxie avatar qtxie commented on May 28, 2024

@dockimbel The WICBitmap API delays the real decoding until it actually need to reads the bitmap data. After the image is loaded, it only decodes the metadata of the image. So img/size works.

Yes. we need to call lock-bitmap and unlock-bitmap to trigger the decoding.

from red.

dockimbel avatar dockimbel commented on May 28, 2024

That commit is referencing the wrong issue, just ignore it.

from red.

Oldes avatar Oldes commented on May 28, 2024

This issue may be closed now.

from red.

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.