-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Converting PNG to AVIF is very slow #4277
Comments
Triage: this looks like the same issue as libvips/libvips#2983 as completely disabling IntraBC mode (see e.g. commit kleisauke/libheif@9aff88d) makes the timings more expected. Before: $ time vipsthumbnail book-collection.png -s 1850x -o x.avif[Q=55]
real 0m2.070s
user 0m3.569s
sys 0m0.098s
$ time vipsthumbnail book-collection.png -s 1849x -o x.avif[Q=55]
real 0m0.675s
user 0m1.702s
sys 0m0.068s After: $ time vipsthumbnail book-collection.png -s 1850x -o x.avif[Q=55]
real 0m0.849s
user 0m2.210s
sys 0m0.062s
$ time vipsthumbnail book-collection.png -s 1849x -o x.avif[Q=55]
real 0m0.675s
user 0m1.702s
sys 0m0.068s |
Thanks Kleis, I agree with your assessment, maybe we should use your libheif patch with the prebuilt binaries for now? |
Patching the prebuilt binaries sounds like a good plan to me. |
Is there I can get a prebuilt binary with the patch to test this and see if the patch fixes it? Or is this a PR where I could follow along? |
@styfle Please see libvips/libvips#2983 (comment) if you'd like to follow along - there are changes to both libheif and libvips required for this. |
Possible bug
Is this a possible bug in a feature of sharp, unrelated to installation?
npm install sharp
completes without error.node -e "require('sharp')"
completes without error.If you cannot confirm both of these, please open an installation issue instead.
Are you using the latest version of sharp?
sharp
as reported bynpm view sharp dist-tags.latest
.If you cannot confirm this, please upgrade to the latest version and try again before opening an issue.
If you are using another package which depends on a version of
sharp
that is not the latest, please open an issue against that package instead.What is the output of running
npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp
?Does this problem relate to file caching?
The default behaviour of libvips is to cache input files, which can lead to
EBUSY
orEPERM
errors on Windows.Use
sharp.cache(false)
to switch this feature off.sharp.cache(false)
does not fix this problem.Does this problem relate to images appearing to have been rotated by 90 degrees?
Images that contain EXIF Orientation metadata are not auto-oriented. By default, EXIF metadata is removed.
To auto-orient pixel values use the parameter-less
rotate()
operation.To retain EXIF Orientation use
keepExif()
.Using
rotate()
orkeepExif()
does not fix this problem.What are the steps to reproduce?
Download this png
Then run the following code:
What is the expected behaviour?
Should take about 800ms but it actually takes 2700ms.
You can see the difference if you change
.resize(1850)
to.resize(1849)
.The text was updated successfully, but these errors were encountered: