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


PHP image::geterror方法代码示例

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


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

示例1: scandir

        $tags2[] = $folder;
    }
}
$i = 0;
foreach ($cur_folder as $current_folder) {
    //Check for images in folder and add them one by one.
    $files = scandir($path . $current_folder);
    foreach ($files as $file) {
        $extension = explode(".", $file);
        if ($extension['1'] == "jpg" || $extension['1'] == "jpeg" || $extension['1'] == "png" || $extension['1'] == "bmp" || $extension['1'] == "gif") {
            $uploaded_image = false;
            //Extension looks good, toss it through the image processing section.
            $dl_url = $site_url . $path . rawurlencode($current_folder) . "/" . rawurlencode($file);
            $iinfo = $image->getremoteimage($dl_url);
            if ($iinfo === false) {
                $error = $image->geterror() . "<br />Could not add the image.";
            } else {
                $uploaded_image = true;
            }
            //Ok, download of image was successful! (yay?)
            if ($uploaded_image == true) {
                $iinfo = explode(":", $iinfo);
                $tclass = new tag();
                $misc = new misc();
                $ext = strtolower(substr($iinfo[1], -4, 10000));
                $source = $db->real_escape_string(htmlentities($_POST['source'], ENT_QUOTES, 'UTF-8'));
                $title = $db->real_escape_string(htmlentities($_POST['title'], ENT_QUOTES, 'UTF-8'));
                $tags = strtolower($db->real_escape_string(str_replace('%', '', htmlentities($tags2[$i], ENT_QUOTES, 'UTF-8'))));
                $ttags = explode(" ", $tags);
                $tag_count = count($ttags);
                if ($tag_count == 0) {
开发者ID:logtcn,项目名称:gelbooru-fork,代码行数:31,代码来源:batch_add.php

示例2: image

        $no_upload = true;
    }
}
if ($no_upload) {
    print "You do not have permission to upload.";
    exit;
}
if (isset($_POST['submit'])) {
    $image = new image();
    $uploaded_image = false;
    $parent = '';
    $error = '';
    if (empty($_FILES['upload']) && isset($_POST['source']) && $_POST['source'] != "" && substr($_POST['source'], 0, 4) == "http" || $_FILES['upload']['error'] != 0 && isset($_POST['source']) && $_POST['source'] != "" && substr($_POST['source'], 0, 4) == "http") {
        $iinfo = $image->getremoteimage($_POST['source']);
        if ($iinfo === false) {
            $error = $image->geterror() . "<br />Could not add the image.";
        } else {
            $uploaded_image = true;
        }
    } else {
        if (!empty($_FILES['upload']) && $_FILES['upload']['error'] == 0) {
            $iinfo = $image->process_upload($_FILES['upload']);
            if ($iinfo === false) {
                $error = $image->geterror() . "<br />An error occured. The image could not be added because it already exists or it is corrupted.";
            } else {
                $uploaded_image = true;
            }
        } else {
            print "No image given for upload.";
        }
    }
开发者ID:xfirespeed,项目名称:TyP-Gallery,代码行数:31,代码来源:post_add.php

示例3: substr

     continue;
 }
 $extension = substr(strrchr($file, '.'), 1);
 $extension = strtolower($extension);
 print "<strong>{$file}</strong><br/>";
 if ($extension == "jpg" || $extension == "jpeg" || $extension == "png" || $extension == "bmp" || $extension == "gif") {
     $uploaded_image = false;
     $processed_files++;
     //Extension looks good, toss it through the image processing section.
     //$dl_url = $site_url.$path.rawurlencode($current_folder)."/".rawurlencode($file);
     $dl_url = $site_url . $path . rawurlencode($current_folder) . "/" . rawurlencode($file);
     $dl_url = str_replace("%2F", "/", $dl_url);
     echo "URL:" . $dl_url . "<br/>";
     $iinfo = $image->getremoteimage($dl_url);
     if ($iinfo === false) {
         $error = $image->geterror();
     } else {
         $uploaded_image = true;
     }
     //Ok, download of image was successful! (yay?)
     if ($uploaded_image == true) {
         echo "No errors encountered, commencing upload<br/>";
         $iinfo = explode(":", $iinfo);
         $tclass = new tag();
         $misc = new misc();
         $ext = strtolower(substr($iinfo[1], -4, 10000));
         $source = $db->real_escape_string(htmlentities($_POST['source'], ENT_QUOTES, 'UTF-8'));
         if (isset($_POST['title'])) {
             $title = $db->real_escape_string(htmlentities($_POST['title'], ENT_QUOTES, 'UTF-8'));
         } else {
             $title = $db->real_escape_string(htmlentities($file, ENT_QUOTES, 'UTF-8'));
开发者ID:Jerglekakan,项目名称:someGelbooruScripts,代码行数:31,代码来源:recursive_batch_add.php


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