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

Feature: Do not add to big sized Image Setting #6726

Closed
Zeromax opened this issue Feb 11, 2014 · 13 comments
Closed

Feature: Do not add to big sized Image Setting #6726

Zeromax opened this issue Feb 11, 2014 · 13 comments

Comments

@Zeromax
Copy link

Zeromax commented Feb 11, 2014

In a current project I have the problem that the user is uploading Image files wich pixel size is taller than the GDLib size. They are added to the Filesystem unresized.

I cannot increase the GDLib size because of server limitations. So I am asking to add the Following:

  • Add a bool Config Setting to prevent files from adding to the Filesystem, if the pixel size is taller than the onfigured GDLib Size.
  • For Compatibility Reasons this can be set to false by default, so the current behavior is still there that images which are to tall still be added to the file tree
  • It would be fine to show an error Message for the user, why this file couldn't be added to the FileTree. Some thing like Only allowed YxZpx size your file has YxZpx
@leofeyer
Copy link
Member

All this exists and is called "maximum image width" and "maximum image height".

@Zeromax
Copy link
Author

Zeromax commented Mar 18, 2014

Sorry, thats not correct.

I made the following Config for better explanation:

  • GDLib max Size (Height and width) 2000
  • max Image width and Height 2000
  • uploading a file with 3200x1200
Die Datei Screenshot (22).png wurde erfolgreich hochgeladen.
Das Bild Screenshot (22).png wurde erfolgreich hochgeladen, ist jedoch zu groß für die automatische Bildbearbeitung.

So I do not want this file to be uploaded. Because the pixel size is to big.

@Zeromax
Copy link
Author

Zeromax commented Mar 18, 2014

That's my config:

$GLOBALS['TL_CONFIG']['gdMaxImgWidth'] = 2000;
$GLOBALS['TL_CONFIG']['gdMaxImgHeight'] = 2000;
$GLOBALS['TL_CONFIG']['imageWidth'] = 2000;
$GLOBALS['TL_CONFIG']['imageHeight'] = 2000;
$GLOBALS['TL_CONFIG']['maxImageWidth'] = 2000;
$GLOBALS['TL_CONFIG']['maxImageHeight'] = 2000;

@leofeyer
Copy link
Member

Sorry, my bad. I figured the uploaded images were declined if they exceed the given image dimensions and it is not possible to resize them because they also exceed the GDlib limits. I almost consider this a bug.

@contao/workgroup-core @tristanlins @discordier @JanoschSkuplik What do you think?

@leofeyer leofeyer reopened this Mar 18, 2014
@leofeyer leofeyer added this to the 3.2.9 milestone Mar 18, 2014
@aschempp
Copy link
Member

Difficult…
What use is a maximum image size setting if it is not being applied. On the other hand, this will not prevent FTP uploads or anything...

@discordier
Copy link
Contributor

As I do not use the internal file upload I never ran into this kind of "bug" but I have to admit, it feels wrong being able to upload an image but not using it later on.

IMO the images should already be in some proper "web size" and only minor adjustments and cropping should be applied by the CMS, hence the reason for having cropping etc. available in there at all.

Therefore I vote for declining a file that exceeds the configured values.

@fjacobi
Copy link

fjacobi commented Mar 21, 2014

This would prevent showing the originals in a lightbox or for download purposes as well.

@discordier
Copy link
Contributor

@fjacobi the "originals" are currently being downscaled when being uploaded via the file management in Contao, aren't they? So I do not understand what exactly your point is?

@fjacobi
Copy link

fjacobi commented Mar 21, 2014

@discordier I raised those limits to 8000x8000, so the user can upload them, but they can't be used for resize or anything else (as hinted in the message). But they can still be downloaded or directly served to visitors.
So just because they can't be edited by the GDLibrary shouldn't mean that the user isn't allowed to upload them.

@leofeyer leofeyer modified the milestones: 3.2.10, 3.2.9 Apr 7, 2014
@leofeyer leofeyer modified the milestones: 3.2.11, 3.2.10 May 21, 2014
@leofeyer leofeyer modified the milestones: 3.2.12, 3.2.11 Jun 4, 2014
@tsarma
Copy link

tsarma commented Jun 4, 2014

So just because they can't be edited by the GDLibrary shouldn't mean that the user isn't allowed to upload them.

Yes, I agree with this.
Also we can put a basic css

img {
 max-width : ("Maximum front end width" from setting) !important;
}

@leofeyer
Copy link
Member

But they can still be downloaded or directly served to visitors. So just because they can't be edited by the GDLibrary shouldn't mean that the user isn't allowed to upload them.

That's a strong argument to which I have to agree. I'll close the ticket then.

@Zeromax You might be able to accomplish what you want using the "postUpload" hook.

@leofeyer leofeyer removed this from the 3.2.12 milestone Jun 17, 2014
@Zeromax
Copy link
Author

Zeromax commented Jun 22, 2014

But they can still be downloaded or directly served to visitors. So just because they can't be edited by the GDLibrary shouldn't mean that the user isn't allowed to upload them.

Sorry but you missed the point.

Add a bool Config Setting to prevent files from adding to the Filesystem, if the pixel size is taller than the onfigured GDLib Size.

I don't understand what's the problem. I want to have a checkbox in the system settings which is optional and I can enable it to not upload images which are bigger than the GD-Lib Size.

So the current behaviour stays the same as it is. You can upload as big images as you need.

@fjacobi
Copy link

fjacobi commented Jun 23, 2014

@Zeromax My comment was directly related to @discordier statement above mine.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants