Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,9 @@ public function cloudinary_url( $attachment_id, $size = array(), $transformation
// Check size and correct if string or size.
if ( is_string( $size ) || ( is_array( $size ) && 3 === count( $size ) ) ) {
$intermediate = image_get_intermediate_size( $attachment_id, $size );
$size = $this->get_crop( $intermediate['url'], $attachment_id );
if ( is_array( $intermediate ) ) {
$size = $this->get_crop( $intermediate['url'], $attachment_id );
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@ public function prepare_upload( $post, $down_sync = false ) {
}

// First check if this has a file and it can be uploaded.
$file = get_attached_file( $post->ID );
$file = get_attached_file( $post->ID );
$file_size = 0;
if ( empty( $file ) ) {
return new \WP_Error( 'attachment_no_file', __( 'Attachment did not have a file.', 'cloudinary' ) );
} elseif ( ! file_exists( $file ) ) {
Expand All @@ -347,8 +348,6 @@ public function prepare_upload( $post, $down_sync = false ) {
}
$file = get_attached_file( $post->ID );
$file_size = filesize( $file );
} else {
$file_size = 0;
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
'label' => __( 'Responsive Image Settings', 'cloudinary' ),
),
'enable_breakpoints' => array(
'label' => __( 'Enable Breakpoints', 'cloudinary' ),
'suffix' => __( 'Enable breakpoint generation on upload.', 'cloudinary' ),
'type' => 'checkbox',
'label' => __( 'Enable Breakpoints', 'cloudinary' ),
'suffix' => __( 'Enable breakpoint generation on upload.', 'cloudinary' ),
'type' => 'checkbox',
'default' => 'off',
),
'breakpoints' => array(
'label' => __( 'Max breakpoints', 'cloudinary' ),
Expand Down