I have a logic question about cropping thumbnails in zpBootstrap.
Most of my images are shot in landscape mode. zpBootstrap Displays square thumbnails to view albums. I often will apply some sort of a crop to make sure these landscape images display correctly in the square format seen on the album page.
I have noticed that if I do three different crops on the same image this will create 3 different cropped thumbnails, and Zenphoto appears to always use the most recent one. I was trying to figure out the logic, how does Zenphoto know to use a cropped thumbnail for an image that has one?
The reason I ask is because generating these extra cropped thumbnails on my local server happens in a split second but for some reason on my Godaddy shared server these cropped thumbnails cause severe CPU usage, and I get throttled.
I'm just wondering if I generate all these cropped thumbnails locally and then upload them, will they be loaded for my images. That's why I asked about the logic I don't see anything in the database that designates that an image thumbnail has a custom crop.
You need to be more specific. There are two types of cropping:
I am not familiar enough with zpBootstrap how it does this.
You can technically pre-create the thumbs via your local install and then upload the /cache directory. Be aware that both installs must have the same /albums structure for this to work properly.
I am using The manual cropping on the backend which is stored in the database and only used by the standard default thumb image template functions.
I always create my set of cached images locally and then upload to reduce CPU usage on the server. But I always assumed I could not designate a custom crop locally, upload and have that version load on my live server. The dimension coordinates are written to the DB locally and would be missing on the web.
I have noticed if I were to create 5 -10 custom crops, all are saved to DB. It is when that album page loads and the 5 - 10 custom crops are requested from the server, all at once, that is when the high CPU usage occurs, and I will be throttled for 24 hours. Just generating 5 custom thumbs will cause me to be throttled. Very frustrating.
But I always assumed I could not designate a custom crop locally, upload and have that version load on my live server.
Yes, you can only pre-prepare the cache files that are generated by code. If you want to use the manual crops done locally on the live site you have to migrate the files and the database.
I have no idea why you get that load on them but basically the images still need to be created. Zenphoto does not create them when you crop them manually, it stores the values how to crop them. Unless I am mistaken. I have to admit I never use the manual cropping myself…
I am going to research why Godaddy gets so triggered by such a small compute task. On my local PC it takes about 1 second to generate the proper thumbnails. I'm not getting charged for CPU usage over/time which is very low, I trigger the throttle by sharp increase in resource usage that takes place in a short amount of time.