Resizing images off server

I have a question about resizing images. I want to use a offline image compression tool. If I were to download the uploads, do the resizes, then delete the server side and upload the structure back the same way, all I would need to do is ./launcher rebuild app and rebake the posts?

What problem are you trying to solve?

with exactly the same filenames? And even then, you could have issues with the file SHAs.

I think the thing to do will be to get Discourse to do the resizes the way that you want them.

i want all the originals resized less then 100kb with no resolution changes. I found a site that does it without issues but to save overall space on the server. the file name i can rechange in bulk to delete the extension it gives.

If you are going to let users on your forum upload images, you want a solution that will work for the future, not just the past. So you want to figure out what settings Discourse offers you to save as much space as is feasible within your parameters.

I’d recommend storing images on S3 so you don’t care so much about how much space costs. But that doesn’t help.

I think you just want to change max_image_height and max_image_width and maybe also max image size kb.

1 Like

I already changed the size they can upload but still have a lot of space. Ive been banned from S3 before from what i believe was due to my location at the time but they never gave a reason. I tried to contact them and never a response at the time. I dont want to waste time with them.

There are many S3 providerers now. See Configure an S3 compatible object storage provider for uploads.

I’m pretty sure that even if you can figure out how to do what you’re trying to do, you’ll be sorry that you did.

How is that even possible? If an image is resized, then its resolution is changed. Those are same thing. Or don’t I understand the question?

TS means: to apply a higher (jpeg) compression ratio.
That will keep the same width x height and reduce file size.

There are some settings for this in Settings - Files

  • recompress original jpg quality
  • png to jpg quality
  • image preview jpg quality
  • composer media optimization image encode quality

For historical files, you don’t need an external service. You can do it on-server by going through all your uploaded files and running

mogrify -quality XX filename.jpg where XX is the quality%.

That said, I do agree with @pfaffman that it’s better to save on storage costs by finding a less expensive storage service. What is an acceptable image quality right now isn’t in 5 years, and you’ll regret having done it. After all, there’s no way back when you lower the quality of an image.

1 Like