Project

General

Profile

Actions

Bug #77190

closed

ImageMainpulation for SVG only scales but does not crop

Added by Sebastian Müller over 8 years ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2016-07-21
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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

pdf-in-textmedia.png (33.5 KB) pdf-in-textmedia.png Sebastian Müller, 2016-11-07 13:24
pdf-in-textmedia-page-module.png (29.4 KB) pdf-in-textmedia-page-module.png Sebastian Müller, 2016-11-07 13:24

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #93942: Remove Imagecropping at SVG Files?Closed2021-04-19

Actions
Actions #1

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.

Actions #2

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

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
Actions #4

Updated by Alexander Opitz about 8 years ago

  • Status changed from Needs Feedback to New
Actions #5

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

Actions #6

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?

Actions #7

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?

Actions #8

Updated by Riccardo De Contardi about 4 years ago

  • Status changed from Needs Feedback to New
Actions #9

Updated by Benni Mack about 1 year ago

  • Related to Bug #93942: Remove Imagecropping at SVG Files? added
Actions #10

Updated by Georg Ringer 6 months ago

  • Status changed from New to Resolved

with #93942 svgs can now natively cropped

Actions #11

Updated by Benni Mack 5 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF