Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: converting the images from one type to another  (Read 1951 times)

0 Members and 1 Guest are viewing this topic.

roshanjameer

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
converting the images from one type to another
« on: April 09, 2008, 04:09:56 pm »

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
Code: [Select]
<?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();
?>

« Last Edit: April 09, 2008, 07:30:34 pm by Joachim Müller »
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.