Skip to content

Commit a462899

Browse files
committed
remove clean and get true size
1 parent 7a948d0 commit a462899

File tree

1 file changed

+2
-7
lines changed
  • cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/media

1 file changed

+2
-7
lines changed

cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/media/class-filter.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -318,25 +318,20 @@ public function filter_out_local( $content ) {
318318
wp_parse_str( $query, $args );
319319
$transformations = $this->media->get_transformations_from_string( $args['cld_params'] );
320320
}
321-
322321
// Get the WP size from the class name.
323-
$wp_size = $this->get_size_from_image_tag( $asset );
322+
$wp_size = $this->media->get_crop( $url, $attachment_id );
324323
if ( false === $wp_size ) {
325324
// No class name, so get size from the width and height tags.
326325
$wp_size = $this->get_crop_from_image_tag( $asset );
327-
if ( empty( $wp_size ) ) {
328-
$wp_size = 'full'; // Fallback to full if nothing is found at all.
329-
}
330326
}
331327

332328
// Get a cloudinary URL.
333-
$clean = ! is_admin(); // Front facing images must not contain a wpsize url variable.
334329
$classes = $this->get_classes( $asset ); // check if this is a transformation overwrite.
335330
$overwrite_transformations = false;
336331
if ( false !== strpos( $classes, 'cld-overwrite' ) ) {
337332
$overwrite_transformations = true;
338333
}
339-
$cloudinary_url = $this->media->cloudinary_url( $attachment_id, $wp_size, $transformations, null, $overwrite_transformations, $clean );
334+
$cloudinary_url = $this->media->cloudinary_url( $attachment_id, $wp_size, $transformations, null, $overwrite_transformations );
340335

341336
if ( $url === $cloudinary_url ) {
342337
continue;

0 commit comments

Comments
 (0)