Skip to content

Commit 8016886

Browse files
committed
only down sync images
1 parent 4df9d0e commit 8016886

File tree

1 file changed

+6
-3
lines changed
  • cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/sync

1 file changed

+6
-3
lines changed

cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/sync/class-storage.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,12 @@ public function sync( $attachment_id ) {
176176
break;
177177
case 'dual_low':
178178
$transformations = $this->media->get_transformation_from_meta( $attachment_id );
179-
// Add low quality transformations.
180-
$transformations[] = array( 'quality' => 'auto:low' );
181-
$url = $this->media->cloudinary_url( $attachment_id, 'full', $transformations, null, false, true );
179+
// Only low res image items.
180+
if ( ! $this->media->is_preview_only( $attachment_id ) && wp_attachment_is_image( $attachment_id ) ) {
181+
// Add low quality transformations.
182+
$transformations[] = array( 'quality' => 'auto:low' );
183+
}
184+
$url = $this->media->cloudinary_url( $attachment_id, '', $transformations, null, false, true );
182185
break;
183186
case 'dual_full':
184187
if ( ! empty( $previous_state ) && 'dual_full' !== $previous_state ) {

0 commit comments

Comments
 (0)