Jump to content

FieldtypeImage resource use


asbjorn
 Share

Recommended Posts

I have a page on a shared hosting service, with a I/O max usage of 3072.0 KB/s . This is usually more than ok, but when I upload large images and resize them (to thumbnail and front end), the I/O usage skyrockets and often hits the limit.

I am no server pro, and have asked my hosting company if this is a problem, and gotten an vague answer. So I am jumping ahead a few steps and asking here how people handle large images in ProcessWire?

We are talking about images up to 10–15 MB, sizes up to 5184x3456 or more. I like to keep the original in case of future resizing. Maybe I'm overkilling it anyway, and maybe it's uneccessary. But still I wonder how other ProcessWire-users handles I/O usage and images.

Link to comment
Share on other sites

For resizing an image the whole image needs to be loaded into memory (at least for gd lib, which is used by processwire until now), therefore it's expectable to hit a limit of 3MB/s when needing to read a file of more than three times that size. Even on a dedicated server there can be speed or memory issues with this kind of image sizes. So you either need to think about if shared hosting is the correct environment or if you could limit down the size of the images to be processed. 

The latter option could be manual or automatic client side shrinkage of too big images. If you still need the original images you'd want to store them in a file field instead of an image field. This will prevent that thumbs are generated from the big image. 

Yesterday ryan did push an update to the pw 3.0 branch, which added the possibility to use other image processing libraries than gd, which might be more catered to processing big images efficiently, but depending on the shared hosting these might not be available.

  • Like 4
Link to comment
Share on other sites

... We are talking about images up to 10–15 MB, sizes up to 5184x3456 or more. ...

OMG. :)

How many users will upload images to this site? Multiple / different users, or only you?

I personally use max size = 2500px for the largest dimension of an (original) image. I create those with Photoshop in max quality before uploading.

  • Like 1
Link to comment
Share on other sites

How many users will upload images to this site? Multiple / different users, or only you?

Two people for the most part on the largest images which cause 100 % peaks. And that's only a couple of times a day.

Workflow has been my main concern here. As a part of teaching others to post news articles and such, I have told them that original image files should be used. Very few people remember what they're told about image resolution, I have tried for years.

I think the client side resize module is my best chance at still having a workable workflow. So I will try that.

Thanks for all the suggestions and information about the technical side of this as well.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...