Skip to content

Commit

Permalink
fix: thumbnails cropping mode not affecting the resulting optimole im…
Browse files Browse the repository at this point in the history
…ages
  • Loading branch information
selul committed Mar 25, 2019
1 parent 34e0d85 commit 0f6dacb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions inc/app_replacer.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ protected static function image_sizes() {
'thumb' => array(
'width' => intval( get_option( 'thumbnail_size_w' ) ),
'height' => intval( get_option( 'thumbnail_size_h' ) ),
'crop' => get_option( 'thumbnail_crop', false ),
'crop' => (bool) get_option( 'thumbnail_crop', false ),
),
'medium' => array(
'width' => intval( get_option( 'medium_size_w' ) ),
Expand Down Expand Up @@ -225,12 +225,12 @@ public function init() {
*/
public function set_properties() {

$upload_data = wp_upload_dir();
$this->upload_resource = array(
$upload_data = wp_upload_dir();
$this->upload_resource = array(
'url' => str_replace( array( 'https://', 'http://' ), '', $upload_data['baseurl'] ),
'directory' => $upload_data['basedir'],
);
$this->upload_resource['url_length'] = strlen( $this->upload_resource['url'] );
$this->upload_resource['url_length'] = strlen( $this->upload_resource['url'] );

$content_parts = parse_url( content_url() );

Expand Down
1 change: 0 additions & 1 deletion inc/tag_replacer.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public function init() {
public function process_image_tags( $content, $images = array() ) {
$image_sizes = self::image_sizes();
$sizes2crop = self::size_to_crop();

foreach ( $images[0] as $index => $tag ) {
$width = $height = false;
$image_tag = $images['img_tag'][ $index ];
Expand Down

0 comments on commit 0f6dacb

Please sign in to comment.