PHP Uploading & Converting Help Needed.

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
techku

PHP Uploading & Converting Help Needed.

Post by techku »

Hi guys, I am working on a website and I need a small amount of help, I have an upload script I have been slightly working on (not own on scripting) and the website I am working on calls for a image file conversion of .tga to .png

here is my code

Code: Select all

if (isset($_POST['Submit']) && $_POST['Submit'] == "Upload") {
	$foto_upload->the_temp_file = $_FILES['upload']['tmp_name'];
	$foto_upload->the_file = $_FILES['upload']['name'];
	$foto_upload->http_error = $_FILES['upload']['error'];
	$foto_upload->replace = (isset($_POST['replace'])) ? $_POST['replace'] : "n"; // because only a checked checkboxes is true
	$foto_upload->do_filename_check = "n"; 
	if ($foto_upload->upload()) {
		$foto_upload->process_image(false, true, true, 80);
		$foto_upload->message[] = "Processed foto: ".$foto_upload->file_copy."!"; // "file_copy is the name of the foto"
	}
I need to get this code below to convert

Code: Select all

$foto_upload->replace = (isset($_POST['replace'])) ? $_POST['replace'] : "n"; // because only a checked checkboxes is true
Any suggestions to doing this? it would be very helpful. I know the code to convert would be something similar to this

Code: Select all

$foto_upload->convert = (isset($_POST['convert'])) exec('convert file.tga file.png');
Thanks In Advance
- Techku
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: PHP Uploading & Converting Help Needed.

Post by Bonzo »

I can not understand classes; if you wanted to do it without using a class I could probably help.

I have some code examples here: http://www.rubblewebs.co.uk/imagemagick/code.php
techku

Re: PHP Uploading & Converting Help Needed.

Post by techku »

yeah, read that like 6 times.. no help.

Anyone else wanna try?

Need my code to convert from one filetype example

Code: Select all

convert filetype1.tga filetype2.png
in this format

Code: Select all

$foto_upload->convert = (isset($_POST['convert'])) exec('convert file.tga file.png');
Post Reply