当前位置: 首页>>代码示例>>PHP>>正文


PHP image::makethumbnailfolder方法代码示例

本文整理汇总了PHP中image::makethumbnailfolder方法的典型用法代码示例。如果您正苦于以下问题:PHP image::makethumbnailfolder方法的具体用法?PHP image::makethumbnailfolder怎么用?PHP image::makethumbnailfolder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在image的用法示例。


在下文中一共展示了image::makethumbnailfolder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: scandir

            if ($ext == "png") {
                return true;
            } else {
                if ($ext == "bmp") {
                    return true;
                } else {
                    return false;
                }
            }
        }
    }
}
$dir_contents = scandir($dir);
foreach ($dir_contents as $item) {
    if (is_dir($dir . $item) && $item != '.' && $item != '..') {
        $dirs[] = $item;
    }
}
foreach ($dirs as $current) {
    $dir_contents = scandir("./images/" . $current . "/");
    foreach ($dir_contents as $item) {
        if ($item != '.' && $item != '..' && !is_dir($dir . $item) && is_valid_extension($item) && !file_exists("./thumbnails/{$current}/thumbnail_{$item}")) {
            $image = new image();
            if (!is_dir("./thumbnails/" . $current . "/")) {
                $image->makethumbnailfolder($current);
            }
            $image->thumbnail($current . "/" . $item);
            print "./thumbnails/" . $current . "/thumbnail_" . $item . "<br>\n";
        }
    }
}
开发者ID:xfirespeed,项目名称:TyP-Gallery,代码行数:31,代码来源:thumbs_fix.php

示例2: getimagesize

     if ($rating == "q") {
         $rating = "Questionable";
     } else {
         $rating = "Safe";
     }
 }
 if ($userc->check_log()) {
     $user = $checked_username;
 } else {
     $user = "Anonymous";
 }
 $ip = $db->real_escape_string($_SERVER['REMOTE_ADDR']);
 $isinfo = getimagesize("./images/" . $iinfo[0] . "/" . $iinfo[1]);
 $query = "INSERT INTO {$post_table}(creation_date, hash, image, title, owner, height, width, ext, rating, tags, directory, source, active_date, ip) VALUES(NOW(), '" . md5_file("./images/" . $iinfo[0] . "/" . $iinfo[1]) . "', '" . $iinfo[1] . "', '{$title}', '{$user}', '" . $isinfo[1] . "', '" . $isinfo[0] . "', '{$ext}', '{$rating}', '{$tags}', '" . $iinfo[0] . "', '{$source}', '" . date("Ymd") . "', '{$ip}')";
 if (!is_dir("./thumbnails/" . $iinfo[0] . "/")) {
     $image->makethumbnailfolder($iinfo[0]);
 }
 if (!$image->thumbnail($iinfo[0] . "/" . $iinfo[1])) {
     print "Thumbnail generation failed! A serious error occured and the image could not be resized.<br /><br />";
 }
 if (!$db->query($query)) {
     print "failed to upload image.";
     print $query;
     unlink("./images/" . $iinfo[0] . "/" . $iinfo[1]);
     $image->folder_index_decrement($iinfo[0]);
     $ttags = explode(" ", $tags);
     foreach ($ttags as $current) {
         $tclass->deleteindextag($current);
     }
 } else {
     $query = "SELECT id, tags FROM {$post_table} WHERE hash='" . md5_file('./images/' . $iinfo[0] . "/" . $iinfo[1]) . "' AND image='" . $iinfo[1] . "' AND directory='" . $iinfo[0] . "'  LIMIT 1";
开发者ID:xfirespeed,项目名称:TyP-Gallery,代码行数:31,代码来源:post_add.php


注:本文中的image::makethumbnailfolder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。