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

Restricting image file size #390

Open
Moschn opened this issue Apr 9, 2019 · 5 comments
Open

Restricting image file size #390

Moschn opened this issue Apr 9, 2019 · 5 comments

Comments

@Moschn
Copy link
Contributor

Moschn commented Apr 9, 2019

Many events contain posters that are in the order of multiple megabytes. The current AMIV website downloads 14Mb of files, and all of the big files are images from events.

I think there are four solutions to this problem:

  1. Manually tell people to be careful about the file size
  2. The admin to validat tools could disallow big file sizes
  3. Add a validator rule to the APIe file size
  4. Add ImageMagick bindings to the API to automatically compress images

In my opinion, we should go with option 3 or 4.

@NotSpecial
Copy link
Contributor

We already use ImageMagick, so 4 might be easy to implement..maybe using a query parameter, like compress?

@NotSpecial
Copy link
Contributor

Additionally, caching for images should make sense, as noted by @temparus in #389 .

@Moschn
Copy link
Contributor Author

Moschn commented Apr 9, 2019

I did not know that the API already uses ImageMagick. A compress query parameter would be a nice solution. Maybe even combined with a validator rule?

Caching would decrease the load on the server but the bandwidth to the user would not change. E.g., as a mobile user, I do not want to download 14mb every time I open the AMIV website and I do not really care if the image is cached or not.

@NotSpecial
Copy link
Contributor

How do you imagine the validator rule? We do not want to force event people to store e.g. the poster anywhere else than in the API -- which file size would you recommend to not cause any problems?

And regarding your second point: It's true that the first time you open the website, you won't save data, but the website doesn't change that frequently, so I think it would save you bandwidth if the image is already cached.

@Moschn
Copy link
Contributor Author

Moschn commented Apr 9, 2019

Ah you are talking about that kind of cache. This obviously makes sense...

I do not think that people would go somewhere else to store their images. If we enforce a rule of lets say 1Mb per image then only extremely large images will have issues. The biggest resolution we are talking about would maybe be 1920x1080 for the infoscreen and an uncompressed image with 32bit per pixel would be around 8Mb of size. I am convinced that losless compression on any poster would lead to a file size of less than 1Mb. If the users are unable to compress it themselves, we can point them to the compress option.

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

2 participants