当前位置: 首页>>代码示例>>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;未经允许,请勿转载。