Page 1 of 1

PHP Uploading & Converting Help Needed.

Posted: 2007-06-13T13:24:49-07:00
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

Re: PHP Uploading & Converting Help Needed.

Posted: 2007-06-13T14:06:39-07:00
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

Re: PHP Uploading & Converting Help Needed.

Posted: 2007-06-13T14:22:48-07:00
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');