verythorough
Forum Replies Created
-
I think I found a way to disable Photon on your Artists page.
I tried the jetpack_photon_skip_image filter in about fifteen different ways on my own site, and never got it to do anything. However, in the article that Adam linked, there was a link to another article using a different strategy:
remove_filter( 'image_downsize', array( Jetpack_Photon::instance(), 'filter_image_downsize' ) );
I put that in one of my custom page templates, right before starting the loop. On the one page that uses that template, Photon didn’t run, and test-cropped images displayed properly. On all other pages, Photon ran fine.
There are a few other ways you could incorporate that line into your code (like framing it in an is_page conditional in the functions file). If you want to de-activate and re-activate within the same page, the article describes how to do that, too.
The workaround you ended up using is what I was trying to suggest in my first post, back when I thought you were manually uploading custom crops made outside of WP (though you used a much longer filename variation!)
You do have more auto-resized alternate files than I expected, because I assumed you wouldn’t have so many tiny image sizes. It seems like you could eliminate the 80×80 (since you don’t use) and 45×45 (just resize the 150 via html/css), but I guess whether you do that depends on which you dislike less–the hassle of changing the code, or the nagging knowledge that there’s a bunch of tiny image files on your server that you’ll never use. Personally, I think I’d choose the latter and leave them as they are.
I do find it odd that WP appears to create a file ending in 300×170 (like this), when the original has the exact same dimensions. I thought the code was written to avoid that. At least it didn’t create the larger sizes, as expected.
I agree, this is very complicated, and very frustrating!
None of the images are broken today, but for some reason yesterday, several were. For example, on https://abgallerytribeca.com/andrey-bogoslowsky/, the artist portrait and second painting were both broken, showing a broken image icon instead of the image. If I went to the address of the image, like https://i0.wp.com/abgallerytribeca.com/wp-content/uploads/artists/andrey-bogoslowsky-headshot.jpg, the page gave an error message saying, “We cannot complete this request.” If I removed the i0.wp.com part, and went to your server’s image location, https://abgallerytribeca.com/wp-content/uploads/artists/andrey-bogoslowsky-headshot.jpg, it loaded fine. Also, the (Photon-served) cropped version of the image on the Artists page loaded fine, so I’m not sure what was going on. In any case, it’s working now, so who knows?
As to the number of extra saved images, WordPress creates only one post id per uploaded image, and creates alternate resized images only in the sizes smaller than the original. So in the case of the cropped ones you’ve uploaded now at 300×170 (like https://abgallerytribeca.com/wp-content/uploads/gloria-mclean-featured-photo-for-artist-page.jpg) there’s an additional version at https://abgallerytribeca.com/wp-content/uploads/gloria-mclean-featured-photo-for-artist-page-150×150.jpg, but I doubt there are any others. If you had decided to upload the doubled-dimension version at 600×170, you would have had at least one more variation (300×170), possibly more, depending on your other size settings. Still, manually cropping and uploading for each image that needs it can definitely be a pain.
Oh, I see, when you say you’re manually cropping, you mean you’re doing it by clicking the Edit Image button on the Edit Media page? That makes sense, but I guess I was assuming you meant you were cropping them elsewhere and uploading them.
In your case, it doesn’t seem like all that much overhead, since it looks like it’s only about 10 mew images. Still, I can see how you’d rather just turn off Photon for that particular page.
On the other hand, as I look at your site now, it looks like a great number of your Photon image links are broken (no idea why), so you might want to give up on Photon all together and consider another image CDN. Bummers!
Is it possible to rename your manually cropped images? If so, I think this will be easier than trying to disable Photon on the page, and you’ll still get the benefits of Photon as well.
Try renaming one of your cropped images with a different pattern–for example, change “brian-gormley-300×170.jpg” to “brian-gormley-crop.jpg” or some other variation. Photon assumes that file names that end like “-300×170.jpg” were re-sized by WordPress and strips the “-300×170” part out, looking for the original to modify on Photon’s servers. Without the “-300×170” part, Photon will see this as an entirely different image, and not look for an “original.”
If that works, and you want to get really fancy, you can save your manual crops at 600x340px–in other words, keeping the proportion, but doubling the dimensions (assuming the original exceeds these dimensions). Photon automatically adjusts for high-density displays (like Apple’s Retina), so it will take that higher res (600×340) image and serve it as-is for high-density displays to scale in the browser (keeping them sharp but the right size on the page). On screens with 1-to-1 pixel ratios, it will send a re-sized (300×170) version of the custom crop (no need to download those extra pixels on displays that don’t use them).
Forum: Networking WordPress
In reply to: Sub-domain or Sub-directory?I understand what you’re saying. I know the difference between a second-level domain and a sub-domain. What had me wondering was the unusual way that this particular host handles multiple domains on the same account, with the second domain’s root stored in a subdirectory of the first domain.
I’m sure I didn’t make clear enough what I was asking, but in the end I suppose it doesn’t matter. I did try a subdomain-style multisite network, but in the end I decided that hassles (like dealing with the added /blog prefix on existing posts, etc.) outweighed the benefits for a network of just two sites. I didn’t get far enough to see if the domain mapping plugin worked. I decided revert to backups and did a multiple install with shared database instead.
Thanks.