nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.64k stars 3.99k forks source link

Generating previews for animated webp images fails #30029

Closed pawanrai9999 closed 1 month ago

pawanrai9999 commented 2 years ago

Steps to reproduces bug:-

  1. Upload files to nextcloud(which include .jpeg, .gif, .webp)
  2. run php occ preview:pre-generate
  3. delete the .webp file
  4. run php occ preview:pre-generate
  5. the issue goes away

Nextcloud Log: - { "reqId": "QLuWknpRbkVx8NK49QA6", "level": 3, "time": "2021-11-11T14:58:35+00:00", "remoteAddr": "", "user": "--", "app": "PHP", "method": "", "url": "--", "message": "gd-webp cannot allocate temporary buffer at /var/www/html/lib/private/legacy/OC_Image.php#620", "userAgent": "--", "version": "22.2.0.2", "id": "618dc9bac3434" }

I guess this is similar issue.

Uploading this file definitely causes issues

pawanrai9999 commented 2 years ago

PHP Docs state that animated webp are not supported.

PHP GD and WebP support: Normal WebP (VP8): supported since PHP 5.4 Transparent WebP or alpha transparency (VP8X, VP8L): supported since PHP 7.0 Animated WebP (VP8X): not supported at all.

PHP Doc

We need to detect animated webp and stop scanning them.

szaimen commented 1 year ago

Hi, please update to 24.0.9 or better 25.0.3 and report back if it fixes the issue. Thank you!

My goal is to add a label like e.g. 25-feedback to this ticket of an up-to-date major Nextcloud version where the bug could be reproduced. However this is not going to work without your help. So thanks for all your effort!

If you don't manage to reproduce the issue in time and the issue gets closed but you can reproduce the issue afterwards, feel free to create a new bug report with up-to-date information by following this link: https://github.com/nextcloud/server/issues/new?assignees=&labels=bug%2C0.+Needs+triage&template=BUG_REPORT.yml&title=%5BBug%5D%3A+

lachlanshoesmith commented 1 year ago

i'm still able to reproduce this issue with animated webp files on 25.0.3 upon running occ preview:generate-all: PHP Fatal error: gd-webp cannot allocate temporary buffer in /var/www/html/lib/private/legacy/OC_Image.php on line 722.

joshtrichards commented 5 months ago

A proposed PR is in #38364. I did it last year and never got around to deciding whether to finish it up. So far this issue hasn't gotten any upvotes so I guess it's not important to most people. If you end up here, and it is important, upvote the issue itself (at the top) to assist us with prioritization.