


It means adding a new toolkit (extending the current GD toolkit), AND for each effect (convert, scale, crop. #39: I tried that with the Picture module (adding WebP support). #2063373-40: Cannot save image created from scratch:

So it is very well possible to add support for formats in contrib, either by extending the core GD toolkit or by using another toolkit. Only upon saving, the format comes back into view.īTW: We have added a change to D8 that allows the toolkits to define the supported formats, where formerly it was hardcoded into core. internally always works with 4 (16 or even 32bit) channels, handling all formats the same. internally GD works either with a truecolor image canvas or a palette color canvas and using transparency in either is not straightforwad either. Internally, GD does not handle all formats the same, making it a nightmare to test and support all formats. #37: If I look at the problems we have with correctly supporting gif, I am more inclined to dropping support for gif instead of adding others. #2063373-39: Cannot save image created from scratch: Here the latest patches are about allowing creating an image (of any currently supported image type) without having to read it from a file to begin with. #2340699: GDToolkit has a fixed list of supported types. #37: I would leave the discussion on supporting additional image formats to a separate issue like e.g. #2063373-38: Cannot save image created from scratch: JPEG extension, but also because currently, PHP has no constant for WebP images, which is becoming very popular. JPEG extension?Ĭoming from #2341251: Allow image effects to change the extension: Allow image effects to change the extension, and with #2340699: Let GDToolkit support WEBP image format: GDToolkit has a fixed list of supported types in mind, we need to be careful using the PHP constants, as you mentioned for the. Anyway, should this be a followup? Especially for. And this leads to a next question: Why not all image types? Next type are already defined by PHP (I think in GD): IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_JPEG2000, IMAGETYPE_PNG, IMAGETYPE_SWF, IMAGETYPE_PSD, IMAGETYPE_BMP, IMAGETYPE_WBMP, IMAGETYPE_XBM, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM, IMAGETYPE_IFF, IMAGETYPE_JB2, IMAGETYPE_JPC, IMAGETYPE_JP2, IMAGETYPE_JPX, IMAGETYPE_SWC, IMAGETYPE_ICO. jpeg is a valid JPEG extension too but ::getExtension() will return. We need to limit the extensions to image extensions.Īnd this creates a new discussion: Why only. #2063373-37: Cannot save image created from scratch: to start< I copy the relevnat comments in this comment: PHP 5.5 & MySQL 5.5 20,953 pass, 49 failĬontinuing the discussion from #2063373: Cannot save image created from scratch.

#Drupal convert image format Patch#
PHP 7.1 & MySQL 5.5 Patch Failed to Apply.PHP 7.1.x-dev & MySQL 5.5 Patch Failed to Apply.PHP 5.6 & MySQL 5.5 Patch Failed to Apply.PHP 7 & MySQL 5.5 Patch Failed to Apply.PHP 7.2 & MySQL 5.5 Patch Failed to Apply.PHP 8.0 & MySQL 5.7 Patch Failed to Apply.PHP 7.4 & MySQL 5.7 Patch Failed to Apply.Please note that the PHP installation needs to be compiled with the WebP support in order to enable this format. The GD toolkit and, therefore Image styles, can manage WebP images. Proposed resolutionĪdd usage of IMAGETYPE_WEBP constant support to GDToolkit plugin to allow create Images of WebP formatĭetection of format support historically unsupported by core's GD integration so presence of real support ( internals of PHP) is out of scope of the issue Remaining tasksĪbility to create WebP images using image styles API changes PS: PHP 5.5 has build in support for WebP and since PHP 5.4 will be abandoned somewhere in 2015, it might be easier to just add support for it. Since webp is becoming popular, it would be nice if contrib could change the supportedTypes of GDToolkit without needing the extend the class, or even better add support for WebP out of the box. Related to #2313075: Allow users to upload webp files in image fields
