PicHome 2.0.1

This commit is contained in:
zyx0814
2024-02-06 00:03:33 +08:00
Unverified
parent e464a1bdb9
commit 5d3da83e43
113 changed files with 1473 additions and 1017 deletions

View File

@@ -23,21 +23,7 @@ class getthumb{
else $prefix='';
if($target=self::getThumb($meta,$prefix)){
/*echo $target;die;
if($imginfo=getimagesize(IO::getStream($target))){
if (is_numeric($meta['path'])) {
$cachearr = [
'aid' => $meta['path'],
'path' => $target,
'width'=>$imginfo[0],
'height'=>$imginfo[1],
];
C::t('thumb_cache')->insert_data($cachearr,1);
}*/
return array($target);
/* }else{
return '';
}*/
}
}
@@ -107,13 +93,11 @@ class getthumb{
$filepath = IO::moveThumbFile($cloudpath, $jpg);
if (!isset($filepath['error'])) {
@unlink($jpg);
$jpg = $cloudpath;
} else {
runlog('imagick', 'uneable move file to target:' . $jpg . $cloudpath);
return '';
}
}
// C::t('pichome_resources')->update_by_rids($meta['appid'], $meta['rid'], array('width' => $owidth, 'height' => $oheight));
return $target;
}else{
return $target;

View File

@@ -34,24 +34,8 @@ class imageColor
if (isset($_G['setting'])) $setting = $_G['setting'];
else $setting = C::t('setting')->fetch_all();
if ($setting['imagelib']) $setting['imagelib'] = extension_loaded($setting['imagelib']) ? $lib : 'gd';
else $setting['imagelib'] = '';
$lib = isset($setting['imagelib']) ? $setting['imagelib'] : (extension_loaded('imagick') ? 'imagick' : 'gd');
$lib = extension_loaded($lib) ? $lib : 'gd';
//if ($lib == 'gd') {
// $exts = getglobal('config/gdgetcolorextlimit');
// $extsarr = explode(',', $exts);
$lib = (isset($setting['imagelib']) && $setting['imagelib']) ? (extension_loaded('imagick') ? 'imagick' : 'gd') :'gd' ;
// } else {
// $exts = getglobal('config/imageickallowextlimit') . ',' . getglobal('config/gdgetcolorextlimit');
// $extsarr = explode(',', $exts);
//}
//if (!in_array($data['ext'], $extsarr)) {
// runlog('imageColor', ' unablegetcolor img=' . $data['realpath']);
// return '';
// }
$cachepath = is_numeric($data['path']) ? intval($data['path']) : ($data['rid'] ? $data['rid']:md5($data['realpath']));
if ($infodata = C::t('ffmpegimage_cache')->fetch_by_path($cachepath)) {
$palettes = unserialize($infodata['info']);