English 中文(简体)
在使用购买力平价时继承图像特性
原标题:inheriting image properties when resizing using PHP
  • 时间:2012-05-14 02:46:39
  •  标签:
  • php
  • mysql

我试图利用PHP重新塑造形象,但我可以说明如何正确命名新形象。 当我看一看我的图表时,我有一张身份证,但没有名字。

请让我知道,你们是否需要看到什么东西。 早在现在,我就假定我没有正确的投入,以图形复制。 当我试图重复上报的美元名称时,没有发生。 如果我支持这个步骤,然后再使用图象,重复用空白名称,那么也就没有发生。

我的法典就是这样。

 function chgSize($image, $width, $height){
    $name = $image["name"]; //this is displaying the file name correctly
    $temp = $image["tmp_name"];
    $imgContents = imagecreatefromstring(file_get_contents($temp));
    $blankImage = imagecreatetruecolor(100,100);
       if(imagecopyresampled($blankImage, $imgContents, 0, 0, 0, 0, 100, 100, $width, $height)){ 
           $formattedImage = imagejpeg($blankImage, $name);
           $this->saveImage($formattedImage);
       }
 }


function saveImage($image){
        $newName = $image["name"];
        move_uploaded_file($image[ tmp_name ], "/Applications/XAMPP/xamppfiles/htdocs/images/" . $newName);
        mysql_query("insert into images VALUES( null , $newName )");
        echo "Stored in: " . "/Applications/XAMPP/xamppfiles/htdocs/images/" . $newName;
  }
问题回答

页: 1 它是一个扼杀世界的国家。 添加一个实际的ql字句,就必须在“成果”的引文中具体注明“无效”一词,例如“光彩”代码

你的代码也容易投放,加上您的移动——上载——笔记——正在使用用户提供的数据作为目标文档名称,因此,你允许遥远的用户在你的服务器上指定ANYWHERE号。

如果上载成功或失败,你显然根本无法检查,并且正在任何地方进行。 不是好事。 页: 1 假设问题成功,这是你可能做的最坏事。 只剩下一条路要成功,只有几条冲淡路才能失败。





相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签