jspaint icon indicating copy to clipboard operation
jspaint copied to clipboard

Unable to save a PNG file

Open drbulba opened this issue 3 years ago • 7 comments
trafficstars

I have recently been unable to save PNG files in JSPaint. I am unsure whether it is my pc, browser, files, or JSPaint itself. (Image trying to save is larger than starting canvas)

drbulba avatar Jan 09 '22 08:01 drbulba

Unable to reproduce. Screen Shot 2022-01-09 at 14 53 19 Screen Shot 2022-01-09 at 14 53 22 Screen Shot 2022-01-09 at 14 53 35 Screen Shot 2022-01-09 at 14 53 49

lafoxxx92 avatar Jan 09 '22 11:01 lafoxxx92

What Browser/OS (and which versions) do you use? Step-by-step description possible?

lafoxxx92 avatar Jan 09 '22 12:01 lafoxxx92

Remove the block on multiple downloads in Chrome.

ValZapod avatar Jan 21 '22 23:01 ValZapod

this also happens on Opera/Windows, dunno what its about

On Fri, Jan 21, 2022 at 6:30 PM Valerii Zapodovnikov < @.***> wrote:

Remove the block on multiple downloads in Chrome.

— Reply to this email directly, view it on GitHub https://github.com/1j01/jspaint/issues/272#issuecomment-1018948497, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXG6SSRKVQ6BLS4CAUKKTGLUXHT73ANCNFSM5LRSFD6A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

drbulba avatar Jan 24 '22 03:01 drbulba

Opera/Windows, dunno

Opera is also chrome. 🙄

ValZapod avatar Jan 24 '22 05:01 ValZapod

alright, Mr/Mrs. Zapodovnikov. no need to be sassy.

On Mon, Jan 24, 2022 at 12:03 AM Valerii Zapodovnikov < @.***> wrote:

Opera/Windows, dunno

Opera is also chrome. 🙄

— Reply to this email directly, view it on GitHub https://github.com/1j01/jspaint/issues/272#issuecomment-1019722293, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXG6SSW4WJE35QTTD3IQ5FDUXTMSZANCNFSM5LRSFD6A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

drbulba avatar Jan 24 '22 05:01 drbulba

I use Chrome/MacOs monetary

ReferenceError: UZIP is not defined
    at Function.UPNG.encode._filterZero (https://jspaint.app/lib/UPNG.js:802:34)
    at Function.UPNG.encode.compressPNG (https://jspaint.app/lib/UPNG.js:574:26)
    at Object.UPNG.encode (https://jspaint.app/lib/UPNG.js:434:14)
    at write_image_file (https://jspaint.app/src/functions.js:3361:29)
    at https://jspaint.app/src/functions.js:1046:5
    at new Promise (<anonymous>)
    at getBlob (https://jspaint.app/src/functions.js:1045:11)
    at Object.showSaveFileDialog (https://jspaint.app/src/app.js:259:23)

nouraellm avatar Mar 07 '22 08:03 nouraellm

Also getting this issue in 2023. Using Chrome v108.0.5359.124 and macOS Monterey v12.5.1.

Internal application error.
Unhandled Rejection. 

ReferenceError: UZIP is not defined
    at UPNG.encode._filterZero (https://jspaint.app/lib/UPNG.js:802:34)
    at UPNG.encode.compressPNG (https://jspaint.app/lib/UPNG.js:574:26)
    at UPNG.encode (https://jspaint.app/lib/UPNG.js:434:14)
    at write_image_file (https://jspaint.app/src/functions.js:3365:29)
    at https://jspaint.app/src/functions.js:1047:5
    at new Promise (<anonymous>)
    at getBlob (https://jspaint.app/src/functions.js:1046:11)
    at Object.showSaveFileDialog (https://jspaint.app/src/app.js:260:23)

Doesn't seem to affect all canvasses equally, as a freshly generated piece with a few random brushstrokes doesn't trigger it, but the 0.9 MB png file I imported to edit on JSpaint does.

Would greatly appreciate at least some kind of response from Isaiah regarding this, though seeing as their last commit to anything on Github was more than 2 months ago, I'ven't the highest of hopes.

sabrt00th avatar Jan 09 '23 15:01 sabrt00th

Saving large PNG files should be working now.

It was a bug in UPNG.js. The line with the error tells the story:

	var CMPR = (data.length>10e6 && UZIP!=null) ? UZIP : pako;

For image data larger than 10e6 (assuming bytes, that's 10 MB), it looked for an optional dependency UZIP, incorrectly. Checking if UZIP!=null actually throws an error if UZIP isn't defined; it should use typeof to safely check for a global.

1j01 avatar Jan 14 '23 02:01 1j01