Topic:
PHP Libraries and Frameworks
[ImageMagick] Convert jpeg, gif to png
Good morning- I found this piece of code in the php sources:
-
1
2
3
4
5
6
7
8
9
- johweb wrote: 18/04/2006 at 17h50
-
no… - I confess that I am lazy to create a test page :p
- Well, I’ll try to do that, then.
- johweb wrote: 18/04/2006 at 18:14pm
-
Sent by WeDgEMasTeR - Well, I’ll try to do that, then.
- I think it’s a good idea ^^
- WeDgEMasTeR wrote: 18/04/2006 at 18:45
I can’t test…- I wrote this down:
- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181920212223242526272829303132333435363738394041424344
- Yogui wrote: 18/04/2006 at 22:45 hours
Hi- Your function seems to perform a silly filename change, not a recording per se. This is a tricky technique because you will have a file with a .png extension but the MIME type of the file will still be JPEG, in reality.
- I recommend you use the GD library. This is done in a maximum of 6 lines of code.
- WeDgEMasTeR wrote: 18/04/2006 at 23h27
Yes, I have the impression that it doesn’t convert but renames in a way.-
I’ve been looking around with the GD library a little bit, but I can’t quite make it out.
I’ll need an example.
-
Because in their function they always wait in parameter a file,
but I don’t think that putting image.jpg works, it looks more like you have to make a $file = fopen(image.jpg);
- I’m really struggling, and I can’t find any php script that does this conversion, based on…
- hard-boiled
- Yogui wrote: 18/04/2006 at 23:57 hours
You have to do something like this (simplified script, no security tests) :-
1
2
3
4
5
6
7
8
9
10
11
12
13
- WeDgEMasTeR wrote: 19/04/2006 at 00:30 am
Okay, I understand a little better.- I just made a small correction:
-
1
2
3
4
5
6
7
8
9
10
11
12
13
- Yogui wrote: 19/04/2006 at 00:45am