Home › Forums › Pro Support › Issue with server-side image resizing
- This topic has 1 reply, 2 voices, and was last updated 3 years, 4 months ago by
Tom.
-
AuthorPosts
-
August 7, 2020 at 1:57 pm #18040
Dustin
ParticipantHey there, love the plugin and theme. Premium subscriber here. Just wanted to let you know that in wp-show-posts/inc/functions.php we are seeing that this code is confusing PressThumb (Pagely’s server size image re-sizer and causing errors):
if ( ! empty( $image_atts ) ) : ?> <img src="<?php echo WPSP_Resize( $image_url[0], $image_atts[ 'width' ], $image_atts[ 'height' ], $image_atts[ 'crop' ], true, $image_atts[ 'upscale' ] ); ?>" alt="<?php esc_attr( the_title() ); ?>" itemprop="image" class="<?php echo $settings[ 'image_alignment' ]; ?>" /> <?php else : the_post_thumbnail( apply_filters( 'wpsp_default_image_size', 'full' ), array( 'itemprop' => 'image' ) ); endif;
If there is an image attribute set in the settings, that is what breaks the function. I believe it is because you are using your own WPSP_Resize function. If I don’t put any attributes it will allow the image to display properly. Here is the conversation with a Pagely devops engineer regarding the issue:
We’re not completely familiar with the wp-show-posts plugin features:
Is there any chance there’s a plugin toggle/option that would disable the local image resize features it is attempting to do, while just displaying the image URL?
On a 2nd look, it appears that it’s not related to Webp or Pressthumbs.
I disabled both on the dev site, and this is still the current html output:
<div class=”wp-show-posts-image wpsp-image-center “>
</div>
(Missing <img src=””)
What peaked our interest from the dev site php error logs was this error though:[07-Aug-2020 19:55:06 UTC] WPSP_Resize.process() error: Image file does not exist (or is not an image): /dom34195/wp-content/uploads/2020/07/f31d259a-d02d-4d30-ba5f-86d2e43148dd.jpg We're wondering now if the wp-show-posts/wp-show-posts-pro plugins "in charge" of displaying those expect them to exist on the sites filesystem, in order to populate them with the correct <img src=" html output.
$ ll ~/sites/dev.arbuildjunkie.com/wp-content/uploads/2020/07/ total 8 drwxrwxr-x 2 www-data www-data 4096 Jul 1 07:03 ./ drwxrwxr-x 10 www-data www-data 4096 Aug 1 07:00 ../
Noting: Due to sites upstream image rules that check production image filest & s3 off loading first, those files wouldn’t necessarily exist on-disk for the plugin to open/resize with WPSP_Resize.process().
August 8, 2020 at 4:52 pm #18069Tom
KeymasterHi there,
We’ll be replacing that function soon.
For now, this method is preferred: https://wpshowposts.com/support/topic/show-posts-images-not-working/#post-8324
-
AuthorPosts
- You must be logged in to reply to this topic.