Bug #77190
closedImageMainpulation for SVG only scales but does not crop
0%
Description
If image is uploaded, ImageManipulation button is displayed for all types defined in $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'].
Text shown beside is:
Image manipulation is only available for supported types:
GIF, JPG, JPEG, TIF, TIFF, BMP, PCX, TGA, PNG, PDF, AI, SVG
When manipulating SVG, svg just gets an width and height property and therefore is scaled down in FE. (Could also be archived by Appearance -> Media Adjustments -> width/height). * Calculate new dimensions for SVG image * No cropping, if cropped info present image is scaled down
Wouldn't it be better if button is not displayed for PDF, AI and SVG and text shown next to button does not list $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] as "Image manipulation supported types" but something only listing supported types?
Files
Updated by Frans Saris over 8 years ago
- Status changed from New to Needs Feedback
For pdf and ai it partly makes sense to have the cropping as cropping works for these files (if I'm not mistaken) and when used with the image viewhelper there are converted to PNG/jpg.
Svg is a different story, as it is a vector based file we excluded this file type from the cropping to not loose the quality of the svg.
So IMO we should exclude svg for the cropping tool but not PDF and AI.
Updated by Alexander Opitz about 8 years ago
@Sebastian Kurfuerst: Can you say something to the answer from Frans?
Updated by Sebastian Müller about 8 years ago
- File pdf-in-textmedia.png pdf-in-textmedia.png added
- File pdf-in-textmedia-page-module.png pdf-in-textmedia-page-module.png added
I agree, for SVG icons there should be no cropping button.
PDF/AI: I just tested it with a fresh TYPO3 (7.6.12) with introduction package.
It is not working (tested with both, screenshots only from pdf):- I can not crop it when editing CE (pdf-in-textmedia.png)
- in the page module it is displayed as GIF (pdf-in-textmedia-page-module.png)
- in FE there is no media at all
Updated by Alexander Opitz about 8 years ago
- Status changed from Needs Feedback to New
Updated by Benni Mack over 4 years ago
- Status changed from New to Needs Feedback
Since TYPO3 v10 it is possible to actually define a "fileExtension" https://review.typo3.org/c/Packages/TYPO3.CMS/+/63611 to allow cropping as well. This means - you cannot define in BE depending on the file extension what you could / should do. SVG icons can therefore be cropped or scaled the same way https://forge.typo3.org/issues/75191
Updated by Riccardo De Contardi over 4 years ago
https://review.typo3.org/c/Packages/TYPO3.CMS/+/63611 has been merged if I am not wrong. Does it solve the issue?
Updated by Sebastian Müller over 4 years ago
No, it does not solve the issue. Maybe it could, but if so it does not so by default.
I just set up a new TYPO3-v10 installation (https://git.typo3.org/Packages/TYPO3.CMS.git/shortlog/refs/heads/10.4, the mentioned commits already present),
uploaded an svg (e.g. https://iconmonstr.com/friend-5-svg/),
created a new textmedia element and selected this svg.
Now I cropped the SVG,
but the crop-Preview displayed in the cropping popup and the cropping preview after the cropping popup is closed is not correct,
and after the record is saved, the backend crop-preview (not in the popup) does not show any cropping.
The output in frontend is not correct too (only scaled but not cropped).
I would expect that if I can upload an SVG and have the possibility to crop it (by default on an new installation) that the output would be correct.
If something has to be corfigured to make it work, may the possibility to crop SVGs should not be there by default?
Maybe I'm missing something?
Updated by Riccardo De Contardi about 4 years ago
- Status changed from Needs Feedback to New
Updated by Benni Mack about 1 year ago
- Related to Bug #93942: Remove Imagecropping at SVG Files? added
Updated by Georg Ringer 6 months ago
- Status changed from New to Resolved
with #93942 svgs can now natively cropped