Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Nokia JPEG images header info corrupt, how to fix it
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Nokia JPEG images header info corrupt, how to fix ...
Nokia JPEG images header info corrupt, how to fix it
10-09-2008 6:34 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Dear All,
I'm trying to do PHP uploading of JPEG images.
However, some JPEG images uploaded from certain camera phones, like the Nokia and some Canon cameras, seem to give gd functions some problems.
Example,
when i open these type of files in The GIMP it says
'59 extraneous bytes before marker 0xD9 - EXIF data will be ignored"
According to a user's comment in www.php.net there is a little command-line utility called 'jhead' (available @ 'http://www.sentex.net/~mwandel/jhead/') which when ran strips any unwanted extra meta-data that these camera phones add.
My problem is i don't know if I am allowed to upload and run binary commands in my PlusNet cgi space. If i *could* it might save me some hassle as I could call the utility from inside my PHP script and that way 'fix-up' the image. Thing is i don't know if this is possible as I don't know if PlusNet let me run binary executables on my cgi space.
I am *assuming* this is the best way to handle this. Also tried a comment on www.php.net which basically suggests i use a 'cleaning' function he wrote but it didn't appear to work for the image, and It seemed very simplistic
Anybody know of a better way of solving this? Or alternatively, does anybody know if i can run binary executables in my PlusNet cgi space?
Your help is appreciated.
Many thanks,
Pablo.
I'm trying to do PHP uploading of JPEG images.
However, some JPEG images uploaded from certain camera phones, like the Nokia and some Canon cameras, seem to give gd functions some problems.
Example,
when i open these type of files in The GIMP it says
'59 extraneous bytes before marker 0xD9 - EXIF data will be ignored"
According to a user's comment in www.php.net there is a little command-line utility called 'jhead' (available @ 'http://www.sentex.net/~mwandel/jhead/') which when ran strips any unwanted extra meta-data that these camera phones add.
My problem is i don't know if I am allowed to upload and run binary commands in my PlusNet cgi space. If i *could* it might save me some hassle as I could call the utility from inside my PHP script and that way 'fix-up' the image. Thing is i don't know if this is possible as I don't know if PlusNet let me run binary executables on my cgi space.
I am *assuming* this is the best way to handle this. Also tried a comment on www.php.net which basically suggests i use a 'cleaning' function he wrote but it didn't appear to work for the image, and It seemed very simplistic
Anybody know of a better way of solving this? Or alternatively, does anybody know if i can run binary executables in my PlusNet cgi space?
Your help is appreciated.
Many thanks,
Pablo.
Message 1 of 3
(1,486 Views)
2 REPLIES 2
Re: Nokia JPEG images header info corrupt, how to fix it
12-09-2008 9:30 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Quote from: Pablos ...Or alternatively, does anybody know if i can run binary executables in my PlusNet cgi space?
Yes, you can run binaries from the CGI space. If you are running them from within a php script (or similar) they can be anywhere, if you want to run them from a browser they need to be in your cgi-bin directory.
Message 2 of 3
(450 Views)
Re: Nokia JPEG images header info corrupt, how to fix it
12-09-2008 7:08 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Ben,
Thanks for that reply. I have a confession to make, first thing is not so bad and the second thing is somewhere between bad and serious.
Here goes..
Firstly, i went right ahead and did it anyway. I ran a binary executable in my script by using the 'exec' command. I was lucky that it solved my problem as there was a rather awkward 'feature' of PHP's imagecreatefromjpg() which i was having difficulty with. Thanks a lot to you guys for getting back to me and trying to help me on that. Star.
Second, this is not a nice and i'm deeply sorry for this fact. I wrote a while loop and i failed to write the code to increment counter while inside the loop. This is unrelatead to the original post, by the way. Anywayz, I opened the page on my browser and was wondering why the heck the browser kept on 'refreshing' the page.. then i realised something had gone wrong.
My apologies for this, guys, as i know PlusNet provide a great service to us guys and i hate to think that i contributed in some way to the server's mal-operation. I make a very sincere apology for this and hope that i have not done any damage. Needless to say i corrected the problem with the script, ... a simple schoolboy PHP error
I'm very sorry to all that i did that and I will be very careful in future.
Thanks to all,
Pablo.
Thanks for that reply. I have a confession to make, first thing is not so bad and the second thing is somewhere between bad and serious.
Here goes..
Firstly, i went right ahead and did it anyway. I ran a binary executable in my script by using the 'exec' command. I was lucky that it solved my problem as there was a rather awkward 'feature' of PHP's imagecreatefromjpg() which i was having difficulty with. Thanks a lot to you guys for getting back to me and trying to help me on that. Star.
Second, this is not a nice and i'm deeply sorry for this fact. I wrote a while loop and i failed to write the code to increment counter while inside the loop. This is unrelatead to the original post, by the way. Anywayz, I opened the page on my browser and was wondering why the heck the browser kept on 'refreshing' the page.. then i realised something had gone wrong.
My apologies for this, guys, as i know PlusNet provide a great service to us guys and i hate to think that i contributed in some way to the server's mal-operation. I make a very sincere apology for this and hope that i have not done any damage. Needless to say i corrected the problem with the script, ... a simple schoolboy PHP error
I'm very sorry to all that i did that and I will be very careful in future.

Thanks to all,
Pablo.
Message 3 of 3
(450 Views)
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Nokia JPEG images header info corrupt, how to fix ...