Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
image system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
28 Oct 2020 at 23:07 UTC
Updated:
24 Mar 2024 at 13:56 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
danyg commentedHere is my patch which allows the users to use webp extension for image upload fields and works with built-in image styles.
Comment #3
vasyok commentedThank you danyg! Patch worked. But after after node save i see:
PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'field_slideimage_width' at row 1: INSERT INTO {field_data_field_slideimage} (entity_type, entity_id, revision_id, bundle, delta, language, field_slideimage_fid, field_slideimage_alt, field_slideimage_title, field_slideimage_width, field_slideimage_height) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10); Array ( [:db_insert_placeholder_0] => node [:db_insert_placeholder_1] => 24 [:db_insert_placeholder_2] => 24 [:db_insert_placeholder_3] => slide [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => 36 [:db_insert_placeholder_7] => [:db_insert_placeholder_8] => [:db_insert_placeholder_9] => [:db_insert_placeholder_10] => ) в функции field_sql_storage_field_storage_write() (строка 610 в файле /home/u8615/domains/moybuhgalter.com.ua/modules/field/modules/field_sql_storage/field_sql_storage.module).
Comment #4
danyg commented@VasyOK The WebP support of getimagesize() function was implemented in PHP 7.1.0
In older PHP versions getimagesize() cannot recognize the webp filetypes (This is what I just discovered last week).
Can you confirm that the PHP version is older in your site? If not, we should figure out what's wrong.
Comment #5
vasyok commentedtoday php 5.6
ok i try to update php version
thanx, danyg!
Comment #6
mitthukumawat commentedI have applied the patch #2 in drupal 7.80 and checked the support of webp images.
Testing steps:
Adding after patch screenshots for reference.
Comment #7
mitthukumawat commentedComment #8
poker10 commentedPatch looks good. Adding a related issue as if that backport gets commited with any luck, then we should be able implement more generic solution, instead of this hardcoded one (such as the one currently present in D8/9).
Until that this patch works for us on PHP 7.1+
Comment #9
poker10 commentedComment #10
mgiffordComment #11
poker10 commentedLet's postpone this for #2539478: [D7] Allow image fields to use any extensions the current image toolkit supports (instead of hard-coding jpg, png and gif only) to aim for a generic solution (not the hardcoded one).
Comment #12
mgiffordI don't know why we're trying to add this to D7 at this point. Bumping it up to D10. Hopefully we don't have to wait till 11.
AVIF & WebP are already ready to roll:
https://caniuse.com/?search=avif
https://caniuse.com/?search=webp
Comment #13
poker10 commentedAs far as I know, D10 currently supports WebP without the need of any additional module, so this is only a D7 issue. The original issue is here: #2340699: Let GDToolkit support WEBP image format
D10/11 Avif issue is here: #3202016: Let GDToolkit support AVIF image format.
I agree that it is possible, that this would not move anywhere until the EOL, but let's keep the relevant issues open until then. Thanks!