update Editing.php and Image.php

This commit is contained in:
gtbu 2025-03-19 23:57:16 +01:00
parent a886d2ab94
commit 1334613b76
2 changed files with 10 additions and 3 deletions

View file

@ -1008,7 +1008,8 @@ namespace gp\tool{
$img_alt = str_replace('_', ' ', basename(pathinfo($image, PATHINFO_FILENAME)));
echo '<li>';
echo '<a class="gallery_gallery" data-arg="gallery_gallery" href="'.$image.'" data-cmd="gallery" rel="'.$rel_id.'">'; // title="'.htmlspecialchars($caption).'"
// echo '<a class="gallery_gallery" data-arg="gallery_gallery" href="'.$image.'" data-cmd="gallery" rel="'.$rel_id.'">'; // title="'.htmlspecialchars($caption).'"
echo '<a class="gallery_gallery" data-arg="gallery_gallery" href="'.htmlspecialchars(urlencode($image), ENT_QUOTES, 'UTF-8').'" data-cmd="gallery" rel="'.htmlspecialchars($rel_id, ENT_QUOTES, 'UTF-8').'">';
echo '<img src="'.$thumb_path.'" alt="'.$img_alt.'" />';
echo '<span class="caption">'.$caption.'</span>';
echo '</a>';

View file

@ -477,9 +477,15 @@ namespace gp\tool{
if( !$new_h ){
$new_h = $dst_h;
}
/* $original_w = imagesx($src_img);
$original_h = imagesy($src_img);
$new_h = $original_h * ($new_w / $original_w); */
$dst_img = imagecreatetruecolor($new_w, $new_h);
$new_w = intval($new_w);
$new_h = intval($new_h);
$dst_img = imagecreatetruecolor($new_w, $new_h);
if( !$dst_img ){
trigger_error('dst_img not created');
return false;