August 19, 2016 at 2:28 pm
Hi, I noticed that my grid images were not the same size. After some investigation I noticed the issue occured in lib/aq_resizer.php:process()
For example the image $url is *Login to see link
And my $upload_url is //static.mydomain.com/uploads
The function should’ve match the upload_url prefix to the img url prefix ( // and https:// ) but fails if upload url starts with //. I changed this code:
if(!strncmp($url,$https_prefix,strlen($https_prefix))){ //if url begins with https:// make $upload_url begin with https:// as well
$upload_url = str_replace(http_prefix,$https_prefix,$upload_url);
}
elseif(!strncmp($url,$http_prefix,strlen($http_prefix))){ //if url begins with http:// make $upload_url begin with http:// as well
$upload_url = str_replace($https_prefix,$http_prefix,$upload_url);
}
elseif(!strncmp($url,$relative_prefix,strlen($relative_prefix))){ //if url begins with // make $upload_url begin with // as well
$upload_url = str_replace(array( 0 => "$http_prefix", 1 => "$https_prefix"),$relative_prefix,$upload_url);
}
to this:
if(!strncmp($url,$https_prefix,strlen($https_prefix))){ //if url begins with https:// make $upload_url begin with https:// as well
$upload_url = str_replace(array( 0 => $http_prefix, 1 => $relative_prefix ),$https_prefix,$upload_url);
}
elseif(!strncmp($url,$http_prefix,strlen($http_prefix))){ //if url begins with http:// make $upload_url begin with http:// as well
$upload_url = str_replace(array( 0=> $https_prefix, 1 => $relative_prefix ),$http_prefix,$upload_url);
}
elseif(!strncmp($url,$relative_prefix,strlen($relative_prefix))){ //if url begins with // make $upload_url begin with // as well
$upload_url = str_replace(array( 0 => "$http_prefix", 1 => "$https_prefix"),$relative_prefix,$upload_url);
}
and now it’s fine. It would be great if this could be fixed in future updates.