converting the images from one type to another converting the images from one type to another
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

converting the images from one type to another

Started by roshanjameer, April 09, 2008, 04:09:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

roshanjameer

hi


i have add a link in the user menu to convert the images from one type to another(jpg to gif...).but the script is not working.it is not converting the images.any of your help will be surely appreciated.

thanks
mrjameer

<?php
session_start
();


define('IN_COPPERMINE'true);
define('SEARCH_PHP'true);

require(
'include/init.inc.php');

$myusername=$_SESSION['myusername'];

if (!
USER_ID && $CONFIG['allow_unlogged_access'] == 0) {
    
$redirect $redirect "login.php";
    
header("Location: $redirect");
    exit();
}

pageheader($convert_image['title']);
echo <<< EOT

<form name="frm" method="post" action="">
EOT;

starttable('60%'$convert_image['title']);
if(isset(
$_POST['submit']))
{

$allfiles=$_POST['allfiles'];
$ourfile=$_POST['ourfile'];



$parts explode('.'$allfiles);

$filename1 $parts[0]; 


$convertedfile=$filename1.".".$ourfile;

$path="C:/ImageMagick-6.4.0-Q16/";
umask(000);  
$sys=shell_exec($path."convert $allfiles $convertedfile");

 

if(
$sys)
{
echo 
"successfully converted";
}
else
{
echo "not";
}
}
else
{






?>


        <tr>
            <td class="tableb" align="center" ><?php echo $myusername;?>
                </td></tr>
<tr>
            <td class="tableb" align="center" >
<table border="1" style="border-color:#2C2B2B"><tr>
<td align="center" style="border-color:#2C2B2B">Select The File You Want To Convert</td>
<td align="center" style="border-color:#2C2B2B">
<select name="allfiles">
<?php

$conn4=mysql_connect("localhost","root","root");
mysql_select_db("jamjamcpg");
$sql="SELECT filename FROM cpg14x_pictures WHERE owner_name='$myusername'";
$result=mysql_query($sql,$conn4) or die (mysql_error());
while($newarray=mysql_fetch_array($result))
{
$fname=$newarray['filename'];
echo "<option name=\"$fname\" value=\"$fname\">$fname</option>";
}
echo "</select>";
?>

</td></tr>
<tr>
<td align="center" style="border-color:#2C2B2B">In Which Type You Want To Convert</td>
<td align="center" style="border-color:#2C2B2B">
<select name="ourfile">
<option name="gif" value="gif">GIF</option>
<option name="jpg" value="jpg">JPG</option>
<option name="png" value="png">PNG</option>
<option name="bmp" value="bmp">BMP</option>
<option name="psd" value="psd">PSD</option>
<option name="pcx" value="pcx">PCX</option>
<option name="tga" value="tga">TGA</option>
<option name="tiff" value="tiff">TIFF</option>
<option name="ico" value="ico">ICO</option>
<option name="pgm" value="pgm">PGM</option>
<option name="emz" value="emz">EMZ</option>
<option name="pcd" value="pcd">PCD</option>
</select>
</td></tr>
<tr><td align="center" style="border-color:#2C2B2B" colspan="2">
<input type="submit" name="submit" value="Submit"></td></tr>
</table>
            </td>
        </tr><tr><td bgcolor="454444">&nbsp;</td></tr>
             
                                </table>
                        </td>

</tr>
<?php
endtable
();
echo 
'</form>';
}
pagefooter();
ob_end_flush();
?>