Image maintenance resizing KB. Free or paid cost dependant.

Started by jeffrey scott, August 15, 2009, 05:20:25 PM

Previous topic - Next topic

jeffrey scott

Hello all,

I have a large amount of images on my simple machines forum version 1.1.9 the images have been attached to posts over a period of time and in the last year I think any size in KB / MB has been allowed although they all display at 600 pix.

I have 2 problems , 1st the site is now 3.5 GB largely due to the images.
2nd I need to watermark the images as we have had information and pictures stolen / copied in the past and want to prevent it happening again.

Then looking into the future I would like all images to be automatically resezed and watermarked as users upload them. I'd rather not put a size limit on the upload as I want to keep it easy for users to upload the images.

Can anyone help? Is this already available?

Many Thanks

Jeff

Arantor

Watermarking is being done already - I seem to recall next week for release was mentioned. It won't be applied to images as they are uploaded in case you decide to change it later - instead it is added as images are requested via the attachments.

As for resizing, you could in theory resize them, even in batch, but doing it is complicated. Images don't tend to get resized on upload, though it is possible to do so. The real problem is the processing of doing it, not to mention that it can take a lot of memory which not every host is set up to handle.

jeffrey scott

Thank you Arantor.

I will look out for this in the Mod section and perhaps I don't need to worry about the huge images already on the site but download the uploader tool so that future images will resize automatically.

Thanks again,

Jeff

jeffrey scott

OK I have the watermarking sorted out now, thanks to Digger and his waterlight mod.

I still need to try and reduce the attachment size on the forum as it is currently nearly 3GB ! 2702961.37

Whilst all the files are displayed at 650 pix max the file it self can still be huge, we don't want to limit the size allowed for people to upload as we want to keep it easy for them to attach pictures to their posts. With some images over 2MB it doesn't take long for the size of them to add up!

I have tried to manually resize 1 or 2 of them before, but I have been unable to as they seem to be a funny ext, ideally I would run a program that would resize the entire attachments directorys JPG or GIF OR PNG files to 650 pix max.

Is there such a thing available?

I am running forum version 1.1.10 and I can't see any way of resizing the images?

Thanks in advance

Jeff

Arantor

There isn't a tool that can directly do it for you, owing to the fact that it would very likely take longer than the average server has to run.

That said you should be able to open them in a program that can recognise a file by its contents - I believe GIMP can do this.

jeffrey scott

I have just found an old topic which I have brought back to life,

http://www.simplemachines.org/community/index.php?topic=240014.0

It has a reference to an old mod wich doesn't seem to work on my forum version 1.1.10 but it does look like it should do what I want?

I wonder if this could be re tweaked?

Thanks

Jeff

Kays

It looks like it might work for 1.1 as is. The problem with that mod is that it resizes the image as it's being uploaded.

What I do in my scripts is to check the file size as it's being viewed and then resize if it's too large. It might be possible to adapt this method to SMF. But the fact that the file names are now encypted does present a bit of a challenge.

One thing though, if SMF's resizing functions were used, chances are that there might not be a difference in file size. Kinda defeating the pupose for resizing them

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

jeffrey scott

It would be great if something like that could be done, if each oversize image was resized permanently  as it was viewed then the server size would actually get smaller day by day instead of getting bigger! Maybe that would mean that it would not kill the server by doing it in one go?


Kays

I do have something written whch does seem to work. Just need to convert it for 2.0 and to package it.

One question. I'm currently using the same image dimensions as for posted images. Is that fine or would you  like to set a seperate size for attached images?

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

jeffrey scott

Hi Kays,

Thanks for taking the time to look, I have the maximum thumb nail size set to 650pix wide and I don't really think that they need to be opened up any bigger than that really?

Is that what you meant?

Many Thanks

Jeff

Kays

No, if you go into the Admin CP > Features and Options. There is an option for setting the maximum sizes for posted images. If you don't have a problem with attached images being the same size as that. Then I doin't need to add an admin backend to select the image size.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

jeffrey scott

Hi Kays,

That is set to 650 pix width as well, That's all we need really every image other than avatars to be 650 pix wide.

Thanks

Jeff

Kays

Cool, that'll make it easier. :)

What I've got working will resize any .jpg, .gif or .png image to a given height or width. It does require that GD2 be installed on your server.

I don't have it packaged as a mod yet. But if you are interested in testing it I can post the code.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

jeffrey scott

yes please Kays,

I'll try it on my test site and then if all is well then I can try it on the main site.

Thanks again

Jeff

Kays

Hi, sorry about the long delay.

In principle it's a simple idea but in testing it I encountered a few small obstacles.

The main one being that when it re sized a .png file it ended up having a larger file size than the original. So in order to counter that, I changed it so that any oversized .png file gets converted to .jpg. The same goes for .gif files but I haven't tested those.

Attached is the mod. I haven't submited it yet and am looking for any feedback on it.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

jeffrey scott


jeffrey scott

Hi Kays,

I have installed the mod using the package manager, it said that it was successful but I can't see any effect.

I have looked through all of the settings menu in admin and can't see that I am missing anything.

I'm using SMF 1.1.10 here http://www.ifitstuff.com/testforum/index.php?topic=2.0 .

Any ideas

Thanks

Jeff

jeffrey scott

P.s. I am told that the Server has GD2 installed on it.

Also I have the waterlight mod and ad managerment mod installed on my forum.

Thanks again

Jeff

Kays

Hi, it does look like it's not working for you for some reason..

Can you check for any errors in the forum error log. Also, which mod is the "waterlight mod "?

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

jeffrey scott

Hi Kays,

The water light mod is here http://www.simplemachines.org/community/index.php?topic=333218.0 the feature is switched on in options and settings and when installed there is a waterlight tab with the mod settings.

I have just switched it off for now, I also added you as an administrator to the my test forum as it might be easier for you to look rather than explain to me how to look!!! As I have limited computer skills but learning.

Thanks

Jeff

Advertisement: