P81CFM's avatar

Advice how to manage the upload of pictures/logo

Hi guys this is not a question related to code more about getting an idea how to organize the process of uploading pictures/logo on the server.

I'm working on a control panel and even though I have a very rough idea of how the pictures of certain elements will be display on the public pages of the web app, I'm not sure about the details (size, orientation, crop etc etc).

At the same time my idea was to develop the functionalities to upload pictures (any advice about some tools to use to manage cropping, resizing etc are more than welcome).

Do you think it is better to have a clear idea of how those images will be display or there are some rules that I can apply even before and then modify with the designer the images according to our needs?

Hope to receive some help from someone who worked heavily with images upload

Cheers

0 likes
5 replies
Helmchen's avatar

what we do is simply uploading all images and logos at original size (as long as there is no clear CD regarding these) and then use an combination of image processing and caching to output the images in what ever form, size and format we need and want.

if something changes - all we have to do is clear the cache and change the parameters.

image paths will become something like this

<img class="img-fluid" src="/img/cache/250x80/resize?filename=img/logos/logo.png" />
Route::get('img/cache/{width}x{height}/{method?}', 'ImageProcessorController@response')->where([
    'width' => '[0-9]+',
    'height' => '[0-9]+'
]);

the controller uses https://github.com/Intervention/image to process the images

there's hardly any reason to resize and crop "logos" - but it's easy to refactor these later

I hope I understood the question correctly :D

P81CFM's avatar

Thank you so much for your reply,

do you guys deal with thumbnails as well? If yes do you just save one single file (the original)?

My plan would be to have some restrictions (easy task to accomplish) type: JPG or PNG size: max 3MB (still not sure about this parameter)

The problem of the thumbnails could be a serious issue, I was reading about the fact of having two format and resize on the fly could create problem. But at the same time the task of creating a thumb bring the problem of deciding the size of the thumb.

Helmchen's avatar

I would always save the originals. you can downsize images as much as you want .. but you can't upsize them lossless

I was reading about the fact of having two format and resize on the fly could create problem.

what do you mean? and you don't have to resize them on the fly. You can even create thumbnails right away but also store the originals so you can regenerate them if needed

P81CFM's avatar

I see,

another question related to saving the original, do you recommend to check width and height and also the size and impose some limits?

Helmchen's avatar

Definitely, but above all a minimum resolution makes sense very often

Which filesize limit you need depends on the type. For JPEGs i would probably go for about 2MB, but as you can resize them that's not that important.

Please or to participate in this conversation.