Skip to content
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

Generating previews for animated webp images fails #30029

Closed
pawanrai9999 opened this issue Nov 12, 2021 · 4 comments · Fixed by #38364
Closed

Generating previews for animated webp images fails #30029

pawanrai9999 opened this issue Nov 12, 2021 · 4 comments · Fixed by #38364
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 25-feedback bug feature: previews and thumbnails

Comments

@pawanrai9999
Copy link

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
Copy link
Author

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.

@st3iny st3iny transferred this issue from nextcloud/previewgenerator Dec 1, 2021
@st3iny st3iny changed the title gd-webp cannot allocate temporary buffer Do not attempt to generate previews for animated webp images Dec 1, 2021
@st3iny st3iny added 1. to develop Accepted and waiting to be taken care of bug feature: previews and thumbnails labels Dec 1, 2021
@st3iny st3iny changed the title Do not attempt to generate previews for animated webp images Generating previews for animated webp images fails Dec 6, 2021
@szaimen

This comment was marked as resolved.

@szaimen szaimen added needs info 0. Needs triage Pending check for reproducibility or if it fits our roadmap and removed 1. to develop Accepted and waiting to be taken care of labels Jan 23, 2023
@lachlanshoesmith
Copy link

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 added a commit to joshtrichards/nc-server that referenced this issue May 18, 2023
Fixes nextcloud#30029 and nextcloud#37263

libgd handles animated WEBP images poorly and generates a meaningless error message as a result. We were returning a 500 error for these preview requests (web) and a fatal error at the command-line (occ). Now we bypass libgd if the we detect an animated WEBP image (and simply don't generate the preview). No more 500 error. Should fix occ too.

Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
joshtrichards added a commit to joshtrichards/nc-server that referenced this issue Mar 9, 2024
Fixes nextcloud#30029 and nextcloud#37263

libgd handles animated WEBP images poorly and generates a meaningless error message as a result. We were returning a 500 error for these preview requests (web) and a fatal error at the command-line (occ). Now we bypass libgd if the we detect an animated WEBP image (and simply don't generate the preview). No more 500 error. Should fix occ too.

Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
joshtrichards added a commit to joshtrichards/nc-server that referenced this issue Apr 4, 2024
Fixes nextcloud#30029 and nextcloud#37263

libgd handles animated WEBP images poorly and generates a meaningless error message as a result. We were returning a 500 error for these preview requests (web) and a fatal error at the command-line (occ). Now we bypass libgd if the we detect an animated WEBP image (and simply don't generate the preview). No more 500 error. Should fix occ too.

Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
@joshtrichards
Copy link
Member

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.

joshtrichards added a commit to joshtrichards/nc-server that referenced this issue May 27, 2024
Fixes nextcloud#30029 and nextcloud#37263

libgd handles animated WEBP images poorly and generates a meaningless error message as a result. We were returning a 500 error for these preview requests (web) and a fatal error at the command-line (occ). Now we bypass libgd if the we detect an animated WEBP image (and simply don't generate the preview). No more 500 error. Should fix occ too.

Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
joshtrichards added a commit to joshtrichards/nc-server that referenced this issue May 27, 2024
Fixes nextcloud#30029 and nextcloud#37263

libgd handles animated WEBP images poorly and generates a meaningless error message as a result. We were returning a 500 error for these preview requests (web) and a fatal error at the command-line (occ). Now we bypass libgd if the we detect an animated WEBP image (and simply don't generate the preview). No more 500 error. Should fix occ too.

Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
joshtrichards added a commit to joshtrichards/nc-server that referenced this issue May 29, 2024
Fixes nextcloud#30029 and nextcloud#37263

libgd handles animated WEBP images poorly and generates a meaningless error message as a result. We were returning a 500 error for these preview requests (web) and a fatal error at the command-line (occ). Now we bypass libgd if the we detect an animated WEBP image (and simply don't generate the preview). No more 500 error. Should fix occ too.

Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
joshtrichards added a commit to joshtrichards/nc-server that referenced this issue May 29, 2024
Fixes nextcloud#30029 and nextcloud#37263

libgd handles animated WEBP images poorly and generates a meaningless error message as a result. We were returning a 500 error for these preview requests (web) and a fatal error at the command-line (occ). Now we bypass libgd if the we detect an animated WEBP image (and simply don't generate the preview). No more 500 error. Should fix occ too.

Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
st3iny pushed a commit to joshtrichards/nc-server that referenced this issue May 30, 2024
Fixes nextcloud#30029 and nextcloud#37263

libgd handles animated WEBP images poorly and generates a meaningless error message as a result. We were returning a 500 error for these preview requests (web) and a fatal error at the command-line (occ). Now we bypass libgd if the we detect an animated WEBP image (and simply don't generate the preview). No more 500 error. Should fix occ too.

Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
backportbot bot pushed a commit that referenced this issue Aug 6, 2024
Fixes #30029 and #37263

libgd handles animated WEBP images poorly and generates a meaningless error message as a result. We were returning a 500 error for these preview requests (web) and a fatal error at the command-line (occ). Now we bypass libgd if the we detect an animated WEBP image (and simply don't generate the preview). No more 500 error. Should fix occ too.

Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
backportbot bot pushed a commit that referenced this issue Aug 6, 2024
Fixes #30029 and #37263

libgd handles animated WEBP images poorly and generates a meaningless error message as a result. We were returning a 500 error for these preview requests (web) and a fatal error at the command-line (occ). Now we bypass libgd if the we detect an animated WEBP image (and simply don't generate the preview). No more 500 error. Should fix occ too.

Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
src-r-r pushed a commit to src-r-r/nextcloud-server that referenced this issue Aug 9, 2024
Fixes nextcloud#30029 and nextcloud#37263

libgd handles animated WEBP images poorly and generates a meaningless error message as a result. We were returning a 500 error for these preview requests (web) and a fatal error at the command-line (occ). Now we bypass libgd if the we detect an animated WEBP image (and simply don't generate the preview). No more 500 error. Should fix occ too.

Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 25-feedback bug feature: previews and thumbnails
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@st3iny @joshtrichards @pawanrai9999 @lachlanshoesmith @szaimen and others