Hi All,
I want to write a PHP webpage which allows people to upload images (no
matter what formats) to me and at the same time converts any non-jpeg
image to JPEG.
Here's what I have:
$FileDest = "/uploads/1.gif";
if (!move_uploaded_file($_FILES["file"]["tmp_name"], $FileDest)):
$Error = "Yes";
endif; // This will upload an image to /uploads/1.gif
$V2_MagickCommand = "mogrify -format JPEG ".$FileDest;
exec($V2_MagickCommand); // I tried to use this to convert the image's
format (gif) to JPEG but this doesn't work.
$FileDest2 = "/uploads/1.jpeg";
$V2_MagickCommand2 = "convert ".$FileDest." ".$FileDest2;
exec($V2_MagickCommand2); // I also tried to use this to convert the
image's format (gif) to JPEG but this doesn't work, either.
What seems to be wrong? How do I modify my codes to make my uploading
webpage to work?
Any idea is appreciated! 3 2555
*** Ming wrote/escribió (20 Apr 2004 02:22:57 -0700): I want to write a PHP webpage which allows people to upload images (no matter what formats) to me and at the same time converts any non-jpeg image to JPEG.
Some ideas I can think of:
1) You check whether file was uploaded successfully. Then you proceed in
either case.
2) You process all files, even JPEG or Excel ones. You should check
$_FILES['file']['type']
3) Print the command line passed to mogrify to see what it looks like, just
to make sure there aren't simple syntax typos.
--
--
-- Álvaro G. Vicario - Burgos, Spain
--
Alvaro G Vicario <al******************@telecomputeronline.com> wrote in message news:<13******************************@40tude.net> ... *** Ming wrote/escribió (20 Apr 2004 02:22:57 -0700): I want to write a PHP webpage which allows people to upload images (no matter what formats) to me and at the same time converts any non-jpeg image to JPEG.
Some ideas I can think of:
1) You check whether file was uploaded successfully. Then you proceed in either case.
2) You process all files, even JPEG or Excel ones. You should check $_FILES['file']['type']
3) Print the command line passed to mogrify to see what it looks like, just to make sure there aren't simple syntax typos.
--
Some Explanation:
When I tried to convert an image to JPEG (for example, pic.gif to
pic.jpeg), I would get pic.jpeg.0, pic.jpeg.1, pic.jpeg.2, pic.jpeg.3,
pic.jpeg.4, pic.jpeg.5 instead of simply "pic.jpeg".
I don't know why. Any help?
Ming wrote: Some Explanation:
When I tried to convert an image to JPEG (for example, pic.gif to pic.jpeg), I would get pic.jpeg.0, pic.jpeg.1, pic.jpeg.2, pic.jpeg.3, pic.jpeg.4, pic.jpeg.5 instead of simply "pic.jpeg".
I don't know why. Any help?
Was it an animated GIF? could those be each frame of the animation?
Use Image Magick from the command line to first be sure that it is
working as expected. Once that is figured out, then start putting pieces
in your PHP script.
--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
SEO Competition League: http://seo.koivi.com/ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: js |
last post by:
Hi all,
I currently encounter a problem and it is urgent to me.
After calling the MsgBox.Show(), the message box is shown with non-modal
mode, what is the possible reason??? This only happen...
|
by: Kathy |
last post by:
Hi All
I have a problem - I have an visual basic application that I am currently
converting to .Net - I have a very necessary function that disconnects users
from files on a specific network...
|
by: Vittorio Pavesi |
last post by:
Hello,
I'm using CDO in my VB Application.
Does anybody know how to set the Mail priority (Urgent, Medium, Low) ??
Thanks
Vittorio...
|
by: DraguVaso |
last post by:
Hi,
I have files I need to read, which contains records with a variable lenght.
What I need to do is Copy a Part of such a File to a new File, based on the
a Begin- and End-record.
I used...
|
by: Parvesh |
last post by:
hi,
I am using a webservice which Returns the Result in an XML string,
The XML response i get i svery cumbersome to parse,
But if i could convert it to the Corresponding Class using the...
|
by: zeyais |
last post by:
Here is my HTML:
<style>
..leftcolumn{float:left;width:300px;border: 1px solid #ccc}
..rtcolumn{float:left;width:600px;border: 1px solid #ccc}
</style>
<body>
<div class="leftcolumn"...
|
by: Carlos Lozano |
last post by:
Hello,
I am converting a MS Access application into ASP.NET. It has a many CR
reports that calls external functions in a VBA library.
I have been trying to create a user Function Library (UFL)...
|
by: N. Spiker |
last post by:
I am attempting to receive a single TCP packet with some text ending with
carriage return and line feed characters. When the text is send and the
packet has the urgent flag set, the text read from...
|
by: Hans Schneider |
last post by:
1. in the prg bellow what vars are stored on stack, heap, data segment?
int i;
void main()
{
int j;
int *k = (void *)malloc(1);
}
|
by: raghavendrap |
last post by:
$tmp = 0xc0211082;
$tmp1 = 0xc0000082;
Hello friends,
I got doubt when i am converting negative hexadecimal to a decimal number.Please look at mentioned example below.
...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
|
by: WisdomUfot |
last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
|
by: Oralloy |
last post by:
Hello Folks,
I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA.
My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
|
by: Carina712 |
last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
|
by: Rahul1995seven |
last post by:
Introduction:
In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
|
by: Johno34 |
last post by:
I have this click event on my form. It speaks to a Datasheet Subform
Private Sub Command260_Click()
Dim r As DAO.Recordset
Set r = Form_frmABCD.Form.RecordsetClone
r.MoveFirst
Do
If...
|
by: jack2019x |
last post by:
hello, Is there code or static lib for hook swapchain present?
I wanna hook dxgi swapchain present for dx11 and dx9.
| |