473,473 Members | 2,021 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

EXIF I have a problem

Hey guys...
I have a image string I want to read with exif_read_data() but
exif_read_data() does not read strings, only files.
i can display the picture via php
Header( "Content-type: image/jpg"); echo $string;
save it manually and then read the meta data like this

function EXIFALL($img){
$exif = exif_read_data($img, 0, true);
echo "myimage.jpg:<br />\n";
foreach ($exif as $key =$section) {
foreach ($section as $name =$val) {
echo "$key.$name: $val<br />\n";
}}return;}
(code from http://th.php.net/manual/en/function.exif-read-data.php)

and it will read out the meta data like i want it.
but i would like to read the meta data from the string without my
interaction!

so I tried this

imagejpeg(imagecreatefromstring($string),'temp.jpg ');
EXIFALL('temp.jpg');
unlink ('temp.jpg');

witch creates a temporary.jpg reads it and then deletes it.
but the function imagejpeg() replaces the important meta data from my
original image that i want to read.

what should i do?
thanks for your help

May 5 '07 #1
5 2664
Mohawk Mawk wrote:
imagejpeg(imagecreatefromstring($string),'temp.jpg ');
EXIFALL('temp.jpg');
unlink ('temp.jpg');

witch creates a temporary.jpg reads it and then deletes it.
but the function imagejpeg() replaces the important meta data from my
original image that i want to read.
Try file_put_contents($string,'temp.jpg') instead of
imagecreatejpeg(imagecreatefromstring()).

Remember to use some kind of lock on your temporary files, or give them
random names, to avoid concurrency issues.

Hope that helps,
--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

Q: How do you shoot a blue elephant?
A: With a blue-elephant gun.

Q: How do you shoot a pink elephant?
A: Twist its trunk until it turns blue, then shoot it with
a blue-elephant gun.

May 5 '07 #2
what should i do?
thanks for your help
to be more clear i want to either create a jpg from a stream without
the metadata to be written, o be able to read the metadata directly
from the stream, witch exif_read_data() does not do.

May 5 '07 #3
Try file_put_contents($string,'temp.jpg') instead of
imagecreatejpeg(imagecreatefromstring()).
I tried this but what happens is it creates a 8 byte file named ˙Ř˙ŕ
(witch are the first charachters of my string)

May 5 '07 #4
Mohawk Mawk wrote:
>
>Try file_put_contents($string,'temp.jpg') instead of
imagecreatejpeg(imagecreatefromstring()).

I tried this but what happens is it creates a 8 byte file named ˙Ř˙ŕ
(witch are the first charachters of my string)
Sorry, I can't remember the syntax of every function... Try
file_put_contents('temp.jpg',$string)

--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

Now listening to: Plaid - Spokes (2003) - [8] Get What You Gave (5:16) (95%)
May 5 '07 #5
On May 5, 8:10 pm, Iván Sánchez Ortega <ivansanchez-...@rroba-
escomposlinux.-.punto.-.orgwrote:
Mohawk Mawk wrote:
Try file_put_contents($string,'temp.jpg') instead of
imagecreatejpeg(imagecreatefromstring()).
I tried this but what happens is it creates a 8 byte file named ˙Ř˙ŕ
(witch are the first charachters of my string)

Sorry, I can't remember the syntax of every function... Try
file_put_contents('temp.jpg',$string)

--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

Now listening to: Plaid - Spokes (2003) - [8] Get What You Gave (5:16) (95%)
haha sorry my bad, thank you very much it worked, i also found that i
could do fwrite(fopen("temp.jpg", 'a'),$string); but that would not
create the file so i cant unlink it. i will take your advice and
generate random names, thank you again

May 5 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: K | last post by:
I am absolutly exausted to figure this one out. I require the exif module to work under 5.0.1 but apache (2.0.48) just dies with a 1067 failure, I can't find any usable log info apart from the...
4
by: Jan Schmidt | last post by:
Hi NG, i created my own Picture Gallery, which reads the EXIF Data of each Picture before displaying on website. I'd like to give my users the ability to alter some opened EXIF Values. It would...
0
by: leo | last post by:
hi there i'm using gene cash's EXIF.py module to find out the shoting time of an jpeg image. this module works usually like a beauty, but some images raise an exception: Traceback (most...
5
by: TheGanjaMan | last post by:
Hi everyone, I'm trying to write up a simple image stamper application that stamps the Exif date information from the jpegs that I've taken from my digital camera and saves the new file with the...
1
by: Alfonso Acosta | last post by:
Hi all, exif_read_data() doesn't support URLs (http://php.net/manual/en/function.exif-read-data.php ) but I would like to do that with the minimum traffic and overhead possible. A naive...
14
by: Frank | last post by:
I see that ImageFormat includes exif. But I can't find out if I've System.Drawing.Image.FromStream or something like it can read and/or write that format.
8
by: infoseekar | last post by:
Does anyone know what's the right code to read IPTC metadata. I have the code to read EXIF metadata and it gives me alot of information which I don't need. How do I modify this code so it only...
1
by: SPE - Stani's Python Editor | last post by:
Phatch is a simple to use cross-platform GUI Photo Batch Processor Phatch handles all popular image formats and can duplicate (sub)folder hierarchies. It can batch resize, rotate, apply...
15
tlhintoq
by: tlhintoq | last post by:
I'd like to think I can work out most issues, but this one is kicking my butt. What's worse, is that I know I can't be the first guy to want to add a thumbnail to jpg that doesn't already have one. ...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.