Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Bildgröße im Backend bei svg reduzieren #8684

Closed
stefan-at-work opened this issue Mar 28, 2017 · 6 comments
Closed

Bildgröße im Backend bei svg reduzieren #8684

stefan-at-work opened this issue Mar 28, 2017 · 6 comments
Assignees
Labels
Milestone

Comments

@stefan-at-work
Copy link

Bei der Nutzung z.B. des CE-Text in Zusammenhang mit einem auswählten Bild im svg-Format, wird das svg aufgrund der fehlenden Bildmaße im Backend in voller Breite dargestellt. Dies nimmt bei mehreren untereinander platzierten CE sehr viel Platz in Anspruch.

Schön wäre es, hier die Bildgrößen im BE automatisch zu verkleinern.

@leofeyer
Copy link
Member

@ausi /cc

@ausi
Copy link
Member

ausi commented Mar 28, 2017

@stefan-at-work Lässt sich das Problem mit folgender Änderung in der Controller.php-Datei lösen?

- if ($size[0] > $intMaxWidth || (!$size[0] && !$size[1] && $imgSize[0] > $intMaxWidth))
+ if ($size[0] > $intMaxWidth || (!$size[0] && !$size[1] && ($imgSize[0] > $intMaxWidth || !$imgSize[0])))
  {
      // See #2268 (thanks to Thyon)
-     $ratio = ($size[0] && $size[1]) ? $size[1] / $size[0] : $imgSize[1] / $imgSize[0];
+     $ratio = ($size[0] && $size[1]) ? $size[1] / $size[0] : ($imgSize[0] ? $imgSize[1] / $imgSize[0] : 0);

@leofeyer leofeyer added this to the 3.5.26 milestone Mar 29, 2017
@stefan-at-work
Copy link
Author

@ausi - thx it works

@leofeyer
Copy link
Member

leofeyer commented Apr 18, 2017

@ausi Ist ($imgSize[0] > $intMaxWidth || !$imgSize[0]) dasselbe wie (empty($imgSize[0]) || $imgSize[0] > $intMaxWidth)?

Die zweite Änderung kann ich nicht nachvollziehen. Bei mir lautet die Zeile wie folgt:

$ratio = ($size[0] && $size[1]) ? $size[1] / $size[0] : (($imgSize[0] && $imgSize[1]) ? $imgSize[1] / $imgSize[0] : 0);

Aus welcher Version ist Dein Code?

@ausi
Copy link
Member

ausi commented Apr 18, 2017

Ist ($imgSize[0] > $intMaxWidth || !$imgSize[0]) dasselbe wie (empty($imgSize[0]) || $imgSize[0] > $intMaxWidth)?

Ja, ist das selbe IMO.

Die zweite Änderung kann ich nicht nachvollziehen.

Ich denke die wurde schon in #8653 korrigiert, die Änderung an der if-Abfrage sollte somit ausreichen.

@leofeyer
Copy link
Member

Behoben in 704a749.

jsonn pushed a commit to jsonn/pkgsrc that referenced this issue Apr 25, 2017
# Contao calendar bundle change log

### 4.3.8 (2017-04-24)

 * Correctly use the en dash in the calendar modules (see contao/core#8690).
 * Correctly support 64 character template names everywhere (see contao/core#6819).

# Contao comments bundle change log

### 4.3.8 (2017-04-24)

 * Correctly support 64 character template names everywhere (see contao/core#6819).

# Contao core bundle change log

### 4.3.9 (2017-04-25)

 * Revert the Punycode library changes (see contao/core#8693).

### 4.3.8 (2017-04-24)

 * Inline small images in protected folders in the file manager (see #636).
 * Correctly encode the URL in the DataContainer::switchToEdit() method (see #762).
 * Fix the parent view drag and drop in Firefox (see #666).
 * Correctly display the search results in the extended tree view (see #739).
 * Update the Punycode library to version 2 (see #748).
 * Fix the "delete file" button for non-admin users (see #764).
 * Prevent endless loops in the book navigation module (see contao/core#8665).
 * Limit the maximum size of dimensionless SVGs in the back end (see contao/core#8684).
 * Correctly support 64 character template names everywhere (see contao/core#6819).
 * Remove the UTF-8 BOM when combining files (see contao/core#8689).
 * Correctly move folders with an "@" in their name (see contao/core#8674).
 * Correctly redirect to the last page visited upon login (see contao/core#8632).

### 4.3.7 (2017-03-23)

 * Check the database connection in the WebsiteRootsConfigProvider class.
 * Fix the %2B conversion in the Controller::addToUrl() method.

# Contao listing bundle change log

### 4.3.8 (2017-04-24)

 * Correctly support 64 character template names everywhere (see contao/core#6819).

# Contao news bundle change log

### 4.3.8 (2017-04-24)

 * Correctly support 64 character template names everywhere (see contao/core#6819).

# Contao newsletter bundle change log

### 4.3.8 (2017-04-24)

 * Correctly support 64 character template names everywhere (see contao/core#6819).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants