Ardakilic / WhatTheTag

A Laravel 5.5 Photo Tagging Web Application
59 stars 11 forks source link

Change thumb photo resize spec #40

Closed gbasilisco closed 3 years ago

gbasilisco commented 3 years ago

Hi, where can I set the size (actual I see 300x400) of thumb photo after upload?

Berst regards.

Ardakilic commented 3 years ago

Hello,

You can find the sizes here:

https://github.com/Ardakilic/WhatTheTag/blob/master/resources/views/photos/list.blade.php#L36

And here:

https://github.com/Ardakilic/WhatTheTag/blob/master/app/Photo.php#L67

gbasilisco commented 3 years ago

Hi @Ardakilic , thanks for reply. But I mean a different question. I try to explain better. When I upload the photo, the system creates a thumb on file system. Where can I set spec of the thumb created on file system? Eg change the filename with append 400x300 text but I don’t se where this happen. Best regards.

Ardakilic commented 3 years ago

@gbasilisco The photo library Croppa generates the thumbnails dynamnically depending on the method called. If it's not found on the file system generates and then it caches, if found, it sources the generated one.

Try with original dimensions, then try chaning the sizes and see the generated sizes, you'll see what I mean.

try also changing the dimensions on the image source dynamically from the browser, you'll see it'll be generated almost magically :)

This way, it'll be easier to replace images depending on the altered design.

gbasilisco commented 3 years ago

@Ardakilic than is Croppa library that create the thumb. Do you know if there is a way to set thumb size? I see that the image i too bigger, on the FS the thumb is cropped. So best regards.

Ardakilic commented 3 years ago

@gbasilisco when you call it with the sizes parameters, it generates the thumbnail on the fly and stores on the file system. See the links I've provided earlier. Try changing them and it'll be fine for both old and new uploads.

gbasilisco commented 3 years ago

@Ardakilic ok, many thanks...Now I found the code that you indicate to me. best regards.