EXIF I have a problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mohawk Mawk

    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:<b r />\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(image createfromstrin g($string),'tem p.jpg');
    EXIFALL('temp.j pg');
    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

  • =?ISO-8859-15?Q?Iv=E1n_S=E1nchez_Ortega?=

    #2
    Re: EXIF I have a problem

    Mohawk Mawk wrote:
    imagejpeg(image createfromstrin g($string),'tem p.jpg');
    EXIFALL('temp.j pg');
    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_conten ts($string,'tem p.jpg') instead of
    imagecreatejpeg (imagecreatefro mstring()).

    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.

    Comment

    • Mohawk Mawk

      #3
      Re: EXIF I have a problem

      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.

      Comment

      • Mohawk Mawk

        #4
        Re: EXIF I have a problem

        Try file_put_conten ts($string,'tem p.jpg') instead of
        imagecreatejpeg (imagecreatefro mstring()).
        I tried this but what happens is it creates a 8 byte file named ÿØÿà
        (witch are the first charachters of my string)

        Comment

        • =?ISO-8859-15?Q?Iv=E1n_S=E1nchez_Ortega?=

          #5
          Re: EXIF I have a problem

          Mohawk Mawk wrote:
          >
          >Try file_put_conten ts($string,'tem p.jpg') instead of
          >imagecreatejpe g(imagecreatefr omstring()).
          >
          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_conten ts('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%)

          Comment

          • Mohawk Mawk

            #6
            Re: EXIF I have a problem

            On May 5, 8:10 pm, Iván Sánchez Ortega <ivansanchez-...@rroba-
            escomposlinux.-.punto.-.orgwrote:
            Mohawk Mawk wrote:
            >
            Try file_put_conten ts($string,'tem p.jpg') instead of
            imagecreatejpeg (imagecreatefro mstring()).
            >
            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_conten ts('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("t emp.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

            Comment

            Working...