Comments (8)
Hi Luís, I'm able to reproduce this problem via sharp as well as directly via vipsthumbnail
, so this may be related to an upstream feature/problem (in either libvips or libpng).
vipsthumbnail firefox.jpg -s 256 -o firefox.png[interlace]
Let me look at the vipspng code to see if I can work out what's causing this.
from sharp.
I've just spotted that Github has converted your original "firefox.jpg" image to be PNG format.
$ identify firefox.jpg
firefox.jpg PNG 256x256 256x256+0+0 8-bit sRGB 48.3KB 0.000u 0:00.000
Are you able to publish this image elsewhere as the original JPEG?
from sharp.
That was not GitHub's fault but mine, I made an error in my workflow and I swapped the filenames somewhere.
or you can download from the website: firefox.jpg
The problem still happens with different JPG (truly jpg =P) images.
I don't know if it's relevant, probably not, but the previous image was obtained from the alrra/browser-logos and then converted to JPG with image magick:
convert -alpha remove -background "#FFFFFF" firefox_256x256.png firefox.jpg
from sharp.
Thanks Luís, I've been able to reproduce this problem on a Mac via vipsthmbnail v7.38.5 for other JPEG images.
The problem occurs only when generating interlaced output PNGs from any input format accessed via sequential read (vipsthumbnail uses sequential read by default). The best quick fix for now is to avoid sequential read and accept the increased memory usage this brings.
I'm going to try the libvips master branch on a Linux box to generate as much debug info as possible before reporting this upstream.
from sharp.
Worry not and take your time.
Thanks for the support and awesome package :)
from sharp.
Hi @Couto are you able to test the fix for this bug, now available in master.
npm install lovell/sharp
This change has the added benefit of almost halving the time taken to generate interlaced PNG output.
from sharp.
I'm not getting corrupted images anymore :)
I'm not measuring performance for now, so I can't comment about that, but that's great news too!
Thanks a lot for this.
from sharp.
The fix for this bug is included in v0.5.2 now available via npm. Thank you for reporting this.
from sharp.
Related Issues (20)
- When you use sharp to convert svg to png, something is missing! HOT 2
- Using `clone` and `joinChannel` together apply channel operation to all output HOT 2
- Override HEIC output limitation HOT 1
- Support outputting higher bit-depth AVIF HOT 1
- Which is better between Sharp.metadata() vs fs.stat() to get image size HOT 1
- Keep only specified EXIF, IPTC, and XMP metadata tag values (similar to `withExifMerge`) HOT 2
- default `limitInputPixels` is not set correctly for jpeg input, avif output, yields `Error: Input image exceeds pixel limit` HOT 2
- sharp: Installation error: Prebuilt libvips 8.14.3 binaries are not yet available for win32-x64 HOT 2
- Using `npm install --cpu=x64 --os=win32` on `arm64/darwin` doesn't install the intended native module. HOT 3
- Google cloud storage integration HOT 1
- Suspect `sharp()....toFile()` do not release input file on Windows. HOT 1
- Conversion from PDF to image HOT 1
- Sharp Crash - libvips_42 - windbg - FAST_FAIL_FATAL_APP_EXIT HOT 8
- munmap_chunk(): invalid pointer, on bun HOT 4
- Consider support for the JPEG-XL format in prebuilt binaries HOT 1
- Not getting density value for tiff files HOT 3
- Output of profile conversion in combination with `negate` seems off HOT 4
- Enhancement: provide API overview in docs HOT 4
- `resize()` does not properly handle `orientation` metadata HOT 4
- Image darkening after updating to 0.32.6 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharp.