begin process at 2012 05 31 13:46:18
  Trouver un code source :
 
dans
 
Accueil > Forum > 

Archive PHP

 > 

Archives

 > 

Débutants

 > 

Récupérer la propriété "Commentaites" d'une image


Derniers messages déposésPoser une question dans le forum ou lancer une discussion

Récupérer la propriété "Commentaites" d'une image

vendredi 16 septembre 2005 à 21:47:57 | Récupérer la propriété "Commentaites" d'une image

zaza68

Je souhaiterais récupérer la propriété "Commentaires" qui apparait dans les propriétés d'une image sur l'onglet "Résumé" pour l'afficher sur ma page WEB en php.
Est-ce que quelqu'un pourrait me dire si cette fonction existe ou comment faire pour afficher ce commentaire ?

zaza[blue]
vendredi 16 septembre 2005 à 23:35:52 | Re : Récupérer la propriété "Commentaites" d'une image

ashboody

Membre Club
voila le code. Il n'est pas de moi, J'ai juste encapsulé le tout dans une classe et enlevé les variables globales. J'espere que c'est ce qu'il te faut. J'espere aussi que les sauts de lignes seront corrects dans mon POST. Si ma réponse te va accepte la GetComment()==false) echo "Comment not found"; else echo $header->GetComment(); ?> JPEGTAB[ "JPEG_Segment_Names" ] = array( 0xC0 => "SOF0", 0xC1 => "SOF1", 0xC2 => "SOF2", 0xC3 => "SOF4", 0xC5 => "SOF5", 0xC6 => "SOF6", 0xC7 => "SOF7", 0xC8 => "JPG", 0xC9 => "SOF9", 0xCA => "SOF10", 0xCB => "SOF11", 0xCD => "SOF13", 0xCE => "SOF14", 0xCF => "SOF15", 0xC4 => "DHT", 0xCC => "DAC", 0xD0 => "RST0", 0xD1 => "RST1", 0xD2 => "RST2", 0xD3 => "RST3", 0xD4 => "RST4", 0xD5 => "RST5", 0xD6 => "RST6", 0xD7 => "RST7", 0xD8 => "SOI", 0xD9 => "EOI", 0xDA => "SOS", 0xDB => "DQT", 0xDC => "DNL", 0xDD => "DRI", 0xDE => "DHP", 0xDF => "EXP", 0xE0 => "APP0", 0xE1 => "APP1", 0xE2 => "APP2", 0xE3 => "APP3", 0xE4 => "APP4", 0xE5 => "APP5", 0xE6 => "APP6", 0xE7 => "APP7", 0xE8 => "APP8", 0xE9 => "APP9", 0xEA => "APP10", 0xEB => "APP11", 0xEC => "APP12", 0xED => "APP13", 0xEE => "APP14", 0xEF => "APP15", 0xF0 => "JPG0", 0xF1 => "JPG1", 0xF2 => "JPG2", 0xF3 => "JPG3", 0xF4 => "JPG4", 0xF5 => "JPG5", 0xF6 => "JPG6", 0xF7 => "JPG7", 0xF8 => "JPG8", 0xF9 => "JPG9", 0xFA => "JPG10", 0xFB => "JPG11", 0xFC => "JPG12", 0xFD => "JPG13", 0xFE => "COM", 0x01 => "TEM", 0x02 => "RES", ); $this->JPEGTAB[ "JPEG_Segment_Descriptions" ] = array( /* JIF Marker byte pairs in JPEG Interchange Format sequence */ 0xC0 => "Start Of Frame (SOF) Huffman - Baseline DCT", 0xC1 => "Start Of Frame (SOF) Huffman - Extended sequential DCT", 0xC2 => "Start Of Frame Huffman - Progressive DCT (SOF2)", 0xC3 => "Start Of Frame Huffman - Spatial (sequential) lossless (SOF3)", 0xC5 => "Start Of Frame Huffman - Differential sequential DCT (SOF5)", 0xC6 => "Start Of Frame Huffman - Differential progressive DCT (SOF6)", 0xC7 => "Start Of Frame Huffman - Differential spatial (SOF7)", 0xC8 => "Start Of Frame Arithmetic - Reserved for JPEG extensions (JPG)", 0xC9 => "Start Of Frame Arithmetic - Extended sequential DCT (SOF9)", 0xCA => "Start Of Frame Arithmetic - Progressive DCT (SOF10)", 0xCB => "Start Of Frame Arithmetic - Spatial (sequential) lossless (SOF11)", 0xCD => "Start Of Frame Arithmetic - Differential sequential DCT (SOF13)", 0xCE => "Start Of Frame Arithmetic - Differential progressive DCT (SOF14)", 0xCF => "Start Of Frame Arithmetic - Differential spatial (SOF15)", 0xC4 => "Define Huffman Table(s) (DHT)", 0xCC => "Define Arithmetic coding conditioning(s) (DAC)", 0xD0 => "Restart with modulo 8 count 0 (RST0)", 0xD1 => "Restart with modulo 8 count 1 (RST1)", 0xD2 => "Restart with modulo 8 count 2 (RST2)", 0xD3 => "Restart with modulo 8 count 3 (RST3)", 0xD4 => "Restart with modulo 8 count 4 (RST4)", 0xD5 => "Restart with modulo 8 count 5 (RST5)", 0xD6 => "Restart with modulo 8 count 6 (RST6)", 0xD7 => "Restart with modulo 8 count 7 (RST7)", 0xD8 => "Start of Image (SOI)", 0xD9 => "End of Image (EOI)", 0xDA => "Start of Scan (SOS)", 0xDB => "Define quantization Table(s) (DQT)", 0xDC => "Define Number of Lines (DNL)", 0xDD => "Define Restart Interval (DRI)", 0xDE => "Define Hierarchical progression (DHP)", 0xDF => "Expand Reference Component(s) (EXP)", 0xE0 => "Application Field 0 (APP0) - usually JFIF or JFXX", 0xE1 => "Application Field 1 (APP1) - usually EXIF or XMP/RDF", 0xE2 => "Application Field 2 (APP2) - usually Flashpix", 0xE3 => "Application Field 3 (APP3)", 0xE4 => "Application Field 4 (APP4)", 0xE5 => "Application Field 5 (APP5)", 0xE6 => "Application Field 6 (APP6)", 0xE7 => "Application Field 7 (APP7)", 0xE8 => "Application Field 8 (APP8)", 0xE9 => "Application Field 9 (APP9)", 0xEA => "Application Field 10 (APP10)", 0xEB => "Application Field 11 (APP11)", 0xEC => "Application Field 12 (APP12) - usually [picture info]", 0xED => "Application Field 13 (APP13) - usually photoshop IRB / IPTC", 0xEE => "Application Field 14 (APP14)", 0xEF => "Application Field 15 (APP15)", 0xF0 => "Reserved for JPEG extensions (JPG0)", 0xF1 => "Reserved for JPEG extensions (JPG1)", 0xF2 => "Reserved for JPEG extensions (JPG2)", 0xF3 => "Reserved for JPEG extensions (JPG3)", 0xF4 => "Reserved for JPEG extensions (JPG4)", 0xF5 => "Reserved for JPEG extensions (JPG5)", 0xF6 => "Reserved for JPEG extensions (JPG6)", 0xF7 => "Reserved for JPEG extensions (JPG7)", 0xF8 => "Reserved for JPEG extensions (JPG8)", 0xF9 => "Reserved for JPEG extensions (JPG9)", 0xFA => "Reserved for JPEG extensions (JPG10)", 0xFB => "Reserved for JPEG extensions (JPG11)", 0xFC => "Reserved for JPEG extensions (JPG12)", 0xFD => "Reserved for JPEG extensions (JPG13)", 0xFE => "Comment (COM)", 0x01 => "For temp private use arith code (TEM)", 0x02 => "Reserved (RES)", ); } function GetComment() { //Cycle through the header segments until COM is found or we run out of segments $i = 0; while ( ( $i < count( $this->header) ) && ( $this->header[$i]['SegName'] != "COM" ) ) { $i++; } // Check if a COM segment has been found if ( $i < count( $this->header) ) { // A COM segment was found, return it's contents return $this->header[$i]['SegData']; } else { // No COM segment found return FALSE; } } function Parse_JPEG_Header( $filename ) { $this->LoadArrays(); // prevent refresh from aborting file operations and hosing file ignore_user_abort(true); // Attempt to open the jpeg file - the at symbol supresses the error message about // not being able to open files. The file_exists would have been used, but it // does not work with files fetched over http or ftp. $filehnd = fopen($filename, 'rb'); // Check if the file opened successfully if ( ! $filehnd ) { // Could't open the file - exit echo "

Could not open file $filename

\n"; return FALSE; } // Read the first two characters $data = fread( $filehnd, 2 ); // Check that the first two characters are 0xFF 0xDA (SOI - Start of image) if ( $data != "\xFF\xD8" ) { // No SOI (FF D8) at start of file - This probably isn't a JPEG file - close file and return; echo "

This probably is not a JPEG file

\n"; fclose($filehnd); return FALSE; } // Read the third character $data = fread( $filehnd, 2 ); // Check that the third character is 0xFF (Start of first segment header) if ( $data{0} != "\xFF" ) { // NO FF found - close file and return - JPEG is probably corrupted fclose($filehnd); return FALSE; } // Flag that we havent yet hit the compressed image data $hit_compressed_image_data = FALSE; // Cycle through the file until, one of: 1) an EOI (End of image) marker is hit, // 2) we have hit the compressed image data (no more headers are allowed after data) // 3) or end of file is hit while ( ( $data{1} != "\xD9" ) && (! $hit_compressed_image_data) && ( ! feof( $filehnd ) )) { // Found a segment to look at. // Check that the segment marker is not a Restart marker - restart markers don't have size or data after them if ( ( ord($data{1}) < 0xD0 ) || ( ord($data{1}) > 0xD7 ) ) { // Segment isn't a Restart marker // Read the next two bytes (size) $sizestr = fread( $filehnd, 2 ); // convert the size bytes to an integer $decodedsize = unpack ("nsize", $sizestr); // Save the start position of the data $segdatastart = ftell( $filehnd ); // Read the segment data with length indicated by the previously read size $segdata = fread( $filehnd, $decodedsize['size'] - 2 ); // Store the segment information in the output array $this->header[] = array("SegType" => ord($data{1}), "SegName" => $this->JPEGTAB[ "JPEG_Segment_Names" ][ ord($data{1}) ], "SegDesc" => $this->JPEGTAB[ "JPEG_Segment_Descriptions" ][ ord($data{1}) ], "SegDataStart" => $segdatastart, "SegData" => $segdata ); } // If this is a SOS (Start Of Scan) segment, then there is no more header data - the compressed image data follows if ( $data{1} == "\xDA" ) { // Flag that we have hit the compressed image data - exit loop as no more headers available. $hit_compressed_image_data = TRUE; } else { // Not an SOS - Read the next two bytes - should be the segment marker for the next segment $data = fread( $filehnd, 2 ); // Check that the first byte of the two is 0xFF as it should be for a marker if ( $data{0} != "\xFF" ) { // NO FF found - close file and return - JPEG is probably corrupted fclose($filehnd); return FALSE; } } } // Close File fclose($filehnd); // Alow the user to abort from now on ignore_user_abort(false); return; } } /* end of class */ ?>
vendredi 16 septembre 2005 à 23:37:09 | Re : Récupérer la propriété "Commentaites" d'une image

ashboody

Membre Club
j'ai oublié de citer ma source. http://www.ozhiker.com/electronics/pjmt/library/list_contents.php4?show_fn=JPEG.php


Cette discussion est classée dans : récupérer, afficher, image, propriété, commentaites


Répondre à ce message

Sujets en rapport avec ce message

Récupérer variable d'un menu déroulant. [ par DarkSchneider ] Bonjour, un nouveau problème m'amène en ces lieux. Voilà, je voudrai savoir comment récupérer la valeur saisi dans un menu déroulant. Voici le Ne pas afficher la barre de Menu Image [ par microdav ] Bonjour à vous Internaute,je vous soumets une petite question...Je recherche Code permettant de ne pas faire afficher la barre de menu "Image" sur une afficher les image d'un repertoir et un sous repertoir + upload [ par angelx ] bonjour je voudrais afficher les image d'un reperoire et SOUS Repertoire + faire un uploade sans donner le chemin de l'image en utilisant les image ge Problème affichage image [ par Odyssee ] Bonjour à tous,J'ai stocké des images récupérer par un formulaire dans ma bdd sous un type longblob (je sais que se serait moins lourd de ne stocker q Récupérer le résultat d'une requète pour l'afficher dans un tableau??? [ par DJ'Ska & Dreams... ] Mon problème est le suivant: j'arrive à me connecter à ma base mySQL, lorsque j'execute une requète et que je souhaite afficher mes résultats, mes rés url image sql [ par magicjim ] salut a tous comment fait ton pour afficher une image dans une page :dans ma table g le champs url (avec dedans l'adresse de l'image)et je voudrai sav Comment calculez le nombre d'affichage d'une image sur un site [ par amatrix ] Au fait c'est pour par exemple afficher mon logo sur un autre site et savoir combien de fois celui-ci est afficher grace a une url de l'image du styl Afficher image variable [ par Desperados21 ] Bonjour a tous... Je debute dans le php et j'ai un petit probleme pour affic lien image [ par magicsmacks ] Bonjour,Voilà j'ai un lien image de ce type: et j'avais déjà demandé comment faire pour récupérer le lien qui est entre les guillemets...=> maintenant Afficher une image dont son nom est stocké ds une bd [ par zakichane ] Bonjour j'ai un tout petit probleme et j'aime bien kan m'aide pour le resoudrealors mon problem c ke j'ai stocké les nom des image k e j'ai ds un repe


Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

Photothèque

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,312 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales