Skip to content
This repository has been archived by the owner on Aug 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request #16 from junaidbhura/performance
Browse files Browse the repository at this point in the history
Performance updates
  • Loading branch information
junaidbhura authored Nov 12, 2017
2 parents ffe9702 + 430519a commit c82be9b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions inc/class-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,12 @@ public function get_attachment_image_src( $attachment_id = 0, $size = '', $crop

// Check if file exsists
if ( file_exists( $fly_file_path ) ) {
$image_editor = wp_get_image_editor( $fly_file_path );
if ( ! is_wp_error( $image_editor ) ) {
$image_dimensions = $image_editor->get_size();
$image_size = getimagesize( $fly_file_path );
if ( ! empty( $image_size ) ) {
return array(
'src' => $this->get_fly_path( $fly_file_path ),
'width' => $image_dimensions['width'],
'height' => $image_dimensions['height'],
'src' => $this->get_fly_path( $fly_file_path ),
'width' => $image_size[0],
'height' => $image_size[1],
);
} else {
return array();
Expand Down

0 comments on commit c82be9b

Please sign in to comment.