projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b3a0bf4
)
Images.php
author
Alan Knowles
<alan@roojs.com>
Wed, 23 May 2012 02:07:37 +0000
(10:07 +0800)
committer
Alan Knowles
<alan@roojs.com>
Wed, 23 May 2012 02:07:37 +0000
(10:07 +0800)
Images.php
patch
|
blob
|
history
diff --git
a/Images.php
b/Images.php
index
97ea636
..
1f7c79d
100644
(file)
--- a/
Images.php
+++ b/
Images.php
@@
-238,11
+238,14
@@
class Pman_Core_Images extends Pman
continue;
}
$type = explode('/', $umatch[1]);
continue;
}
$type = explode('/', $umatch[1]);
- $thumbsize =
false
;
- $new_thumbsize =
false
;
+ $thumbsize =
-1
;
+ $new_thumbsize =
-1
;
if (count($type) > 2 && $type[1] == 'Thumb') {
$thumbsize = $type[2];
if (count($type) > 2 && $type[1] == 'Thumb') {
$thumbsize = $type[2];
+ $provider = 'Images/Thumb';
+ } else {
+ $provider = $type;
}
if (!empty($attr['width']) || !empty($attr['height']) )
}
if (!empty($attr['width']) || !empty($attr['height']) )
@@
-261,6
+264,7
@@
class Pman_Core_Images extends Pman
if (!$new_thumbsize) {
$type = array('Image');
} else {
if (!$new_thumbsize) {
$type = array('Image');
} else {
+
$type = array('Image', 'Thumb', $new_thumbsize);
$fc = $img->toFileConvert();
$type = array('Image', 'Thumb', $new_thumbsize);
$fc = $img->toFileConvert();
@@
-272,6
+276,15
@@
class Pman_Core_Images extends Pman
}
}
+ // finally replace the original TAG with the new version..
+ $old_src_tag = 'src="'. $attr[src] . '"';
+ $img = str_replace(
+ 'src="'. $attr[src] . '"',
+ $img->URL($new_thumbsize , $provider, $baseURL=false)
+ 'src="'. $baseURL + implode('/', $type) . '/' . urlencode($img->filename)"',
+
+
+
// make an image url..
// make an image url..