stashapp / stash

An organizer for your porn, written in Go. Documentation: https://docs.stashapp.cc
https://stashapp.cc/
GNU Affero General Public License v3.0
9.22k stars 795 forks source link

[Feature] Performer/Tag Image Compression or rescaling #2988

Open monketybot opened 2 years ago

monketybot commented 2 years ago

Is your feature request related to a problem? Please describe. Sometimes when finding performer/Tag images, I can find a suitable image but not realise the file size is massive. Inputting loads of these images can cause the database filesize to increase dramatically. It isn't necessary for the performer/Tag image to be high quality but it is also not quick to have to download a file, Reencode it and then upload to stash.

Describe the solution you'd like A input box within some image editing section that would allow the user to type a percentage for the image to be shrunk. Pressing a button makes stash automatically rescale the image by this percentage. Below the input box there should be

It would also be helpful if there was a section within the settings which allows the user to see stats on all Performer/Tag Images such as Largest, Smallest, Image Count, overall Database space taken etc. And then a bulk image editing section that allows the user to specify a maximum file size and stash would go through the database and rescale all images to fit within this limit.

Describe alternatives you've considered Another option is to no longer store the images as part of the database, but instead as a separate file within a folder like the thumbnail images are stored. That way any image editing software can do bulk image compression from outside the database.

Additional context It could be tied to some other image handling features like #931 or #1125

ghost commented 2 years ago

Even better imo would be not to store the images within the DB itself.

monketybot commented 2 years ago

Even better imo would be not to store the images within the DB itself.

I would probably agree. But I am not sure of the details on how they are stored currently. Perhaps it started like that and there is no easy way to change it now. Or there is some performance issues with storing them as separate files.

I did see that V0.17.0 is going to have a refactoring of the files, so that might include this change also.

7dJx1qP commented 2 years ago

This could also be done with a plugin/script. I wrote a python script for my own stash that downscales performer images and converted them to jpg. I could probably clean it up and turn it into a plugin.

monketybot commented 2 years ago

This could also be done with a plugin/script.

Even including the file size bit? I figure that this would only be usefull if you know the size of the image before rescaling it.

7dJx1qP commented 2 years ago

This could also be done with a plugin/script.

Even including the file size bit? I figure that this would only be usefull if you know the size of the image before rescaling it.

Yes. In my script I read the images from the database and then check the dimensions. If the width or height is greater than the limit I set, then it resizes the image and saves it back to the database.

I don't check the actual filesize, but that information is also available so it should be possible to resize based off that as well

WeedLordVegeta420 commented 2 years ago

Even better imo would be not to store the images within the DB itself.

That will probably happen eventually. There has been some momentum in that direction in the past - see #2271 and #2491