Closed maurozadu closed 11 years ago
can you show me the output from here:
public static function getImageSrcBySize($relpath, $prefix) {
if (strlen($prefix)==2) $prefix .= '~';
$regexp = '/^(sq|br|bp|cr|ax|bs|bx|ap|as|ar|tn|bm|am)~/';
$path_parts = pathinfo($relpath);
debug($path_parts);
// replace existing prefix, if any, and then prepend
if (preg_match($regexp, $path_parts['basename'])) {
$asset_basename = preg_replace($regexp, $prefix, $path_parts['basename'], 1);
} else {
$asset_basename = $prefix.$path_parts['basename'];
}
return @$path_parts['dirname'].'/'.$asset_basename;
}
Here is a screenshot:
Maybe the problem is because I don't have the images properly linked. I believe it doesn't really matters, as long as it works in your environment it's ok, right?
That's not what I asked for. Can you add this line to the code in bootstrap.php:
$path_parts = pathinfo($relpath);
debug($relpath);
debug($path_parts);
The reason I am concerned is because pathinfo() is a standard php method, and you are not getting the correct output. I am wondering if this is a php version problem. otherwise, it works for me, so it's ok if you can't see the images.
ok, now I got it.
debug($relpath);
shows null
debug($path_parts);
shows this array:
array(
'basename' => '',
'filename' => ''
)
so, I tink the problem is that the method is not receiving the right argument
maybe the problem is that I don't have the assets
table with the proper json string that feeds this method. I asked for that table in issue #22 but I didn't understood your answer.
Thank you.
with the latest changes this is no longer a problem
the line is:
for now I've placed an @ symbol after the return so the error is not shown and I can work, but this is a temporary hack