Skip to content

Commit 7117bf1

Browse files
author
David Cramer
authored
Merge pull request #77 from cloudinary/feature/CLOUD-389
Feature/cloud 389
2 parents 826ad0f + e4a6f6a commit 7117bf1

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,9 @@ public function cloudinary_url( $attachment_id, $size = array(), $transformation
574574
// Check size and correct if string or size.
575575
if ( is_string( $size ) || ( is_array( $size ) && 3 === count( $size ) ) ) {
576576
$intermediate = image_get_intermediate_size( $attachment_id, $size );
577-
$size = $this->get_crop( $intermediate['url'], $attachment_id );
577+
if ( is_array( $intermediate ) ) {
578+
$size = $this->get_crop( $intermediate['url'], $attachment_id );
579+
}
578580
}
579581

580582
/**

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,8 @@ public function prepare_upload( $post, $down_sync = false ) {
330330
}
331331

332332
// First check if this has a file and it can be uploaded.
333-
$file = get_attached_file( $post->ID );
333+
$file = get_attached_file( $post->ID );
334+
$file_size = 0;
334335
if ( empty( $file ) ) {
335336
return new \WP_Error( 'attachment_no_file', __( 'Attachment did not have a file.', 'cloudinary' ) );
336337
} elseif ( ! file_exists( $file ) ) {
@@ -347,8 +348,6 @@ public function prepare_upload( $post, $down_sync = false ) {
347348
}
348349
$file = get_attached_file( $post->ID );
349350
$file_size = filesize( $file );
350-
} else {
351-
$file_size = 0;
352351
}
353352
}
354353
} else {

cloudinary-image-management-and-manipulation-in-the-cloud-cdn/ui-definitions/tabs/settings-global-transformations.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
'label' => __( 'Responsive Image Settings', 'cloudinary' ),
2020
),
2121
'enable_breakpoints' => array(
22-
'label' => __( 'Enable Breakpoints', 'cloudinary' ),
23-
'suffix' => __( 'Enable breakpoint generation on upload.', 'cloudinary' ),
24-
'type' => 'checkbox',
22+
'label' => __( 'Enable Breakpoints', 'cloudinary' ),
23+
'suffix' => __( 'Enable breakpoint generation on upload.', 'cloudinary' ),
24+
'type' => 'checkbox',
25+
'default' => 'off',
2526
),
2627
'breakpoints' => array(
2728
'label' => __( 'Max breakpoints', 'cloudinary' ),

0 commit comments

Comments
 (0)