當前位置: 首頁>>代碼示例>>PHP>>正文


PHP cls_image::gif2jpeg方法代碼示例

本文整理匯總了PHP中cls_image::gif2jpeg方法的典型用法代碼示例。如果您正苦於以下問題:PHP cls_image::gif2jpeg方法的具體用法?PHP cls_image::gif2jpeg怎麽用?PHP cls_image::gif2jpeg使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在cls_image的用法示例。


在下文中一共展示了cls_image::gif2jpeg方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: elseif


//.........這裏部分代碼省略.........
                     $image->fix = "width";
                 }
                 if ($height = $field['height']) {
                     $image->newHeight = $height;
                     $image->fix = "height";
                 }
                 if ($fix = $field['fix']) {
                     $image->fix = $fix;
                 }
             }
             if ($_POST['UploadedImage'] == 1) {
                 $file_name = $site_path . "/images/" . $this->table . "/" . strtolower($name) . "/0.jpg";
                 $file = fopen($file_name, "r");
                 $image->contents = fread($file, filesize($file_name));
                 fclose($file);
                 $image->type = "jpeg";
             } else {
                 $image->check();
             }
             ${$name} = $image->contents;
             $im_array[$im_count]['name'] = $item->name;
             $im_array[$im_count]['image'] = $image->contents;
             if (($width || $height) && $image->type == "gif") {
                 if ($this->mode == 1) {
                     if (!($bgcolor = $field->getAttribute("bgcolor", ''))) {
                         $bgcolor = "ffffff";
                     }
                 } else {
                     if (!($bgcolor = $field['bgcolor'])) {
                         $bgcolor = "ffffff";
                     }
                 }
                 if ($width && $image->width > $width || $height && $image->height > $height) {
                     $image->gif2jpeg($bgcolor);
                 }
             }
             $Type = $image->type;
             $ph[$name] = 1;
             $ph['Small'] = 1;
             if ($image->type != "gif") {
                 $Small = new cls_image($image->imageResize());
                 $Small = $Small->contents;
             } else {
                 $Small = ${$name};
             }
             if ($_POST['UploadedImage'] == 1) {
                 $file_name = $site_path . "/images/" . $this->table . "/" . "small" . "/0.jpg";
                 $file = fopen($file_name, "r");
                 $Small = fread($file, filesize($file_name));
                 fclose($file);
                 $file_name = $site_path . "/images/" . $this->table . "/" . strtolower($name) . "/0.jpg";
                 $file = fopen($file_name, "r");
                 $image->contents = fread($file, filesize($file_name));
                 fclose($file);
             }
             $im_array[$im_count]['small'] = $Small;
             $im_array[$im_count]['type'] = $image->imtype;
             $im_count++;
             $ImageFormat = $image->imtype;
         } elseif ($type == "date" || $type == "currentdate" || $type == "datetime" || $type == "currentdatetime") {
             ${$name} = mktime($_POST['hour'][$ndate], $_POST['minute'][$ndate], $_POST['seconds'][$ndate], $_POST['month'][$ndate], $_POST['day'][$ndate], $_POST['year'][$ndate]);
             if (${$name} == -1 || !$_POST['month'][$ndate] || !$_POST['day'][$ndate] || !$_POST['year'][$ndate]) {
                 unset(${$name});
             }
             $ndate++;
         } elseif ($type == "sqldate") {
開發者ID:dapfru,項目名稱:gladiators,代碼行數:67,代碼來源:_cls_form.php


注:本文中的cls_image::gif2jpeg方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。