SlideShare uma empresa Scribd logo
1 de 8
Baixar para ler offline
[Tips] Membaca Metadata Image JPEG/TIFF
dengan PHP

PHP memiliki kemampuan membaca image / gambar. Dengan kemampuan itu tentu saja PHP mampu
membaca data-data asal yang terdapat dalam image tersebut. Biasanya data tersebut dinamakan
metadata. Proses pembacaan metadata itu cukup mudah, yaitu dengan memanfaatkan fungsi
exif_read_data(). Misal saya memiliki sebuah gambar berekstensi JPEG dengan nama satu.JPEG, yang
berasal dari hasil jepretan kamera digital. Maka data asal dari gambar tersebut dapat dibaca dengan
perintah berikut :

$data = exif_read_data('images/satu.jpg');
echo "< pre >";
print_r( $data );
echo "< /pre >";


Data yang muncul kira-kira seperti berikut:

Array
(
     [FileName] => satu.jpg
     [FileDateTime] => 1335936620
     [FileSize] => 5441417
     [FileType] => 2
     [MimeType] => image/jpeg
     [SectionsFound] => ANY_TAG, IFD0, THUMBNAIL, EXIF, INTEROP
     [COMPUTED] => Array
          (
               [html] => width="4320" height="3240"
               [Height] => 3240
               [Width] => 4320
               [IsColor] => 1
               [ByteOrderMotorola] => 0
               [ApertureFNumber] => f/2.9
[UserComment] =>
        [UserCommentEncoding] => UNDEFINED
        [Copyright] => Copyright 2010
        [Thumbnail.FileType] => 2
        [Thumbnail.MimeType] => image/jpeg
    )


[ImageDescription] =>
[Make] => BenQ Corporation
[Model] => DC C143X
[Orientation] => 1
[XResolution] => 288/3
[YResolution] => 288/3
[ResolutionUnit] => 2
[Software] => 1.7600
[DateTime] => 2012:05:02 12:30:21
[YCbCrPositioning] => 2
[Copyright] => Copyright 2010
[Exif_IFD_Pointer] => 322
[THUMBNAIL] => Array
    (
        [Compression] => 6
        [Orientation] => 1
        [XResolution] => 72/1
        [YResolution] => 72/1
        [ResolutionUnit] => 2
        [JPEGInterchangeFormat] => 4290
        [JPEGInterchangeFormatLength] => 7287
        [YCbCrPositioning] => 2
    )


[ExposureTime] => 1/279
[FNumber] => 29/10
[ExposureProgram] => 2
[ISOSpeedRatings] => 100
[ExifVersion] => 0220
[DateTimeOriginal] => 2012:05:02 12:30:21
[DateTimeDigitized] => 2012:05:02 12:30:21
[ComponentsConfiguration] => �
[CompressedBitsPerPixel] => 500/100
     [ShutterSpeedValue] => 8124/1000
     [ApertureValue] => 3071/1000
     [ExposureBiasValue] => 0/100
     [MaxApertureValue] => 3171/1000
     [MeteringMode] => 4
     [LightSource] => 0
     [Flash] => 24
     [FocalLength] => 6300/1000
     [MakerNote] =>
IP1:1 exp 130 agc: 95 cal_agc : 128 P2C : 16
.
.
.


dan seterusnya. Hanya diambil sebagian karena cukup panjang. Pada bagian tersebut terlihat hampir
semua properti pembuatan gambar tersebut. Antara lain dibuat kapan, dengan menggunakan kamera
apa, ukuran berapa. Untuk keperluan programming biasanya hasil ini akan diatur dengan penguraian
array lanjut. Antara lain kira-kira seperti berikut:


$data = exif_read_data('images/satu.jpg');
foreach($data as $key=>$val) {
     if(is_array($val)) {
          foreach($val as $k=>$v) {
                echo $key."[$k]: $v<br />n";
          }
     } else
          echo "$key: ".@substr($val,0,40)."<br />n";
}


Hasilnya kira-kira akan seperti berikut:


FileName: IMG_0495.JPG


FileDateTime: 1335936620


FileSize: 5441417
FileType: 2


MimeType: image/jpeg


SectionsFound: ANY_TAG, IFD0, THUMBNAIL, EXIF, INTEROP


COMPUTED[html]: width="4320" height="3240"


COMPUTED[Height]: 3240


COMPUTED[Width]: 4320


COMPUTED[IsColor]: 1


COMPUTED[ByteOrderMotorola]: 0


COMPUTED[ApertureFNumber]: f/2.9


COMPUTED[UserComment]:


COMPUTED[UserCommentEncoding]: UNDEFINED


COMPUTED[Copyright]: Copyright 2010


COMPUTED[Thumbnail.FileType]: 2


COMPUTED[Thumbnail.MimeType]: image/jpeg


ImageDescription:


Make: BenQ Corporation


Model: DC C143X


Orientation: 1


XResolution: 288/3
YResolution: 288/3


ResolutionUnit: 2


Software: 1.7600


DateTime: 2012:05:02 12:30:21


YCbCrPositioning: 2


Copyright: Copyright 2010


Exif_IFD_Pointer: 322


THUMBNAIL[Compression]: 6


THUMBNAIL[Orientation]: 1


THUMBNAIL[XResolution]: 72/1


THUMBNAIL[YResolution]: 72/1


THUMBNAIL[ResolutionUnit]: 2


THUMBNAIL[JPEGInterchangeFormat]: 4290


THUMBNAIL[JPEGInterchangeFormatLength]: 7287


THUMBNAIL[YCbCrPositioning]: 2


ExposureTime: 1/279


FNumber: 29/10


ExposureProgram: 2


ISOSpeedRatings: 100


ExifVersion: 0220
DateTimeOriginal: 2012:05:02 12:30:21


DateTimeDigitized: 2012:05:02 12:30:21


ComponentsConfiguration: �


CompressedBitsPerPixel: 500/100


ShutterSpeedValue: 8124/1000


ApertureValue: 3071/1000


ExposureBiasValue: 0/100


MaxApertureValue: 3171/1000


MeteringMode: 4


LightSource: 0


Flash: 24


FocalLength: 6300/1000


MakerNote:
IP1:1 exp 130 agc: 95 cal_agc : 128 P2C


UserComment: ����������������������������������������


SubSecTime: 0�


FlashPixVersion: 0100


ColorSpace: 1


ExifImageWidth: 4320


ExifImageLength: 3240
RelatedSoundFile:


InteroperabilityOffset: 4260


FileSource:


SceneType:


ExposureMode: 0


WhiteBalance: 0


DigitalZoomRatio: 100/100


FocalLengthIn35mmFilm: 36


SceneCaptureType: 33


Contrast: 0


Saturation: 0


Sharpness: 0


InterOperabilityIndex: R98


InterOperabilityVersion: 0100


Dengan demikian, sebenarnya situs-situs fotografi, atau lomba fotografi akan dapat mengetahui bahwa
sebenarnya gambar tersebut asli atau sudah ter-edit oleh software lain seperti potoshop dan lain
sebagainya, meski ternyata metadata ini juga dapat dilakukan editing, yang akan kita pelajari dalam
section lain. Ada yang berminat menjadi roy suryo moderen sebagai ahli metadata?? Silakan belajar
lebih lanjut   . Untuk exif_read_data, hanya dapat digunakan jenis file JPG dan TIFF. Anda juga dapat
mengkombinasikan dengan form upload file.

Sekian, semoga bermanfaat
Wahyu Bimo S
bimosaurus@gmail.com
http://bimosaurus.com

Mais conteúdo relacionado

Destaque

Funcionamientodenotebook
FuncionamientodenotebookFuncionamientodenotebook
Funcionamientodenotebookstephanie407
 
Banrisul na case studies 2012
Banrisul na case studies 2012Banrisul na case studies 2012
Banrisul na case studies 2012Paulo Ratinecas
 
Inter movistar
Inter movistarInter movistar
Inter movistarsopis
 
Gafanhoto #60
Gafanhoto #60Gafanhoto #60
Gafanhoto #60ESGN
 
Criação de poemas(slide)-602
Criação de poemas(slide)-602Criação de poemas(slide)-602
Criação de poemas(slide)-602sandralobo49
 
Case Parada - Prêmio Colunistas
Case Parada - Prêmio ColunistasCase Parada - Prêmio Colunistas
Case Parada - Prêmio ColunistasPedro Araújo
 
Conbinacion de correspondencias
Conbinacion de correspondenciasConbinacion de correspondencias
Conbinacion de correspondenciasshirleygm10
 
The ciberbullying
The ciberbullyingThe ciberbullying
The ciberbullyingobeet666
 
virus en memoria USB
virus en memoria USBvirus en memoria USB
virus en memoria USBcetis27ev
 
Poesiaren bidea
Poesiaren bideaPoesiaren bidea
Poesiaren bideasustatu
 
Ambiente de aprendizaje apoyado con tecnologías de información UNAM
Ambiente de aprendizaje apoyado con tecnologías de información UNAMAmbiente de aprendizaje apoyado con tecnologías de información UNAM
Ambiente de aprendizaje apoyado con tecnologías de información UNAMDianna HM
 
Funcionamiento de notebook
Funcionamiento de notebookFuncionamiento de notebook
Funcionamiento de notebookstephanie407
 
Relatório julho - Quem se Importa
Relatório julho - Quem se ImportaRelatório julho - Quem se Importa
Relatório julho - Quem se ImportaGeneTatuapé
 
Naughty Horror [O espelho - Parte I]
Naughty Horror [O espelho - Parte I]Naughty Horror [O espelho - Parte I]
Naughty Horror [O espelho - Parte I]Rafael Ruiz
 
A lei de acesso à informação
A lei de acesso à informaçãoA lei de acesso à informação
A lei de acesso à informaçãoadri-kay
 
Aula de capacitación profesional 2014 (blog)
Aula de  capacitación profesional 2014 (blog)Aula de  capacitación profesional 2014 (blog)
Aula de capacitación profesional 2014 (blog)Titanium14
 

Destaque (20)

Funcionamientodenotebook
FuncionamientodenotebookFuncionamientodenotebook
Funcionamientodenotebook
 
Banrisul na case studies 2012
Banrisul na case studies 2012Banrisul na case studies 2012
Banrisul na case studies 2012
 
Inter movistar
Inter movistarInter movistar
Inter movistar
 
Gafanhoto #60
Gafanhoto #60Gafanhoto #60
Gafanhoto #60
 
Criação de poemas(slide)-602
Criação de poemas(slide)-602Criação de poemas(slide)-602
Criação de poemas(slide)-602
 
Case Parada - Prêmio Colunistas
Case Parada - Prêmio ColunistasCase Parada - Prêmio Colunistas
Case Parada - Prêmio Colunistas
 
Conbinacion de correspondencias
Conbinacion de correspondenciasConbinacion de correspondencias
Conbinacion de correspondencias
 
Liliana
LilianaLiliana
Liliana
 
The ciberbullying
The ciberbullyingThe ciberbullying
The ciberbullying
 
virus en memoria USB
virus en memoria USBvirus en memoria USB
virus en memoria USB
 
Poesiaren bidea
Poesiaren bideaPoesiaren bidea
Poesiaren bidea
 
Ambiente de aprendizaje apoyado con tecnologías de información UNAM
Ambiente de aprendizaje apoyado con tecnologías de información UNAMAmbiente de aprendizaje apoyado con tecnologías de información UNAM
Ambiente de aprendizaje apoyado con tecnologías de información UNAM
 
Funcionamiento de notebook
Funcionamiento de notebookFuncionamiento de notebook
Funcionamiento de notebook
 
Modulo 1 proinfo
Modulo 1 proinfoModulo 1 proinfo
Modulo 1 proinfo
 
Radiasi benda hitam
Radiasi benda hitamRadiasi benda hitam
Radiasi benda hitam
 
Relatório julho - Quem se Importa
Relatório julho - Quem se ImportaRelatório julho - Quem se Importa
Relatório julho - Quem se Importa
 
Naughty Horror [O espelho - Parte I]
Naughty Horror [O espelho - Parte I]Naughty Horror [O espelho - Parte I]
Naughty Horror [O espelho - Parte I]
 
A lei de acesso à informação
A lei de acesso à informaçãoA lei de acesso à informação
A lei de acesso à informação
 
Aula de capacitación profesional 2014 (blog)
Aula de  capacitación profesional 2014 (blog)Aula de  capacitación profesional 2014 (blog)
Aula de capacitación profesional 2014 (blog)
 
Montelimar
MontelimarMontelimar
Montelimar
 

Semelhante a Metadata php

Observational Science With Python and a Webcam
Observational Science With Python and a WebcamObservational Science With Python and a Webcam
Observational Science With Python and a WebcamIntellovations, LLC
 
Module wise format oops questions
Module wise format oops questionsModule wise format oops questions
Module wise format oops questionsSANTOSH RATH
 
Internal training - Eda
Internal training - EdaInternal training - Eda
Internal training - EdaTony Vo
 
Integrating Angular js & three.js
Integrating Angular js & three.jsIntegrating Angular js & three.js
Integrating Angular js & three.jsJosh Staples
 
How to Make AJAX Applications Scream on the Client
How to Make AJAX Applications Scream on the ClientHow to Make AJAX Applications Scream on the Client
How to Make AJAX Applications Scream on the Clientgoodfriday
 
CE344L-200365-Lab5.pdf
CE344L-200365-Lab5.pdfCE344L-200365-Lab5.pdf
CE344L-200365-Lab5.pdfUmarMustafa13
 
Re-Design with Elixir/OTP
Re-Design with Elixir/OTPRe-Design with Elixir/OTP
Re-Design with Elixir/OTPMustafa TURAN
 
Y1 gd engine_terminology ben comley-excell
Y1 gd engine_terminology ben comley-excellY1 gd engine_terminology ben comley-excell
Y1 gd engine_terminology ben comley-excellBenCom1
 
virtualtouchscreen
virtualtouchscreenvirtualtouchscreen
virtualtouchscreenk.jagan.20
 
Deep learning study 3
Deep learning study 3Deep learning study 3
Deep learning study 3San Kim
 
Advanced iOS Build Mechanics, Sebastien Pouliot
Advanced iOS Build Mechanics, Sebastien PouliotAdvanced iOS Build Mechanics, Sebastien Pouliot
Advanced iOS Build Mechanics, Sebastien PouliotXamarin
 
Build Better Games with Unity and Microsoft Azure
Build Better Games with Unity and Microsoft AzureBuild Better Games with Unity and Microsoft Azure
Build Better Games with Unity and Microsoft AzureXamarin
 
New Features of SQL Server 2016
New Features of SQL Server 2016New Features of SQL Server 2016
New Features of SQL Server 2016Mir Mahmood
 
Synchronizing without internet - Multipeer Connectivity (iOS)
Synchronizing without internet - Multipeer Connectivity (iOS)Synchronizing without internet - Multipeer Connectivity (iOS)
Synchronizing without internet - Multipeer Connectivity (iOS)Jorge Maroto
 
Protractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsProtractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsLudmila Nesvitiy
 

Semelhante a Metadata php (20)

Observational Science With Python and a Webcam
Observational Science With Python and a WebcamObservational Science With Python and a Webcam
Observational Science With Python and a Webcam
 
Module wise format oops questions
Module wise format oops questionsModule wise format oops questions
Module wise format oops questions
 
Internal training - Eda
Internal training - EdaInternal training - Eda
Internal training - Eda
 
myslide1
myslide1myslide1
myslide1
 
myslide6
myslide6myslide6
myslide6
 
NewSeriesSlideShare
NewSeriesSlideShareNewSeriesSlideShare
NewSeriesSlideShare
 
Integrating Angular js & three.js
Integrating Angular js & three.jsIntegrating Angular js & three.js
Integrating Angular js & three.js
 
How to Make AJAX Applications Scream on the Client
How to Make AJAX Applications Scream on the ClientHow to Make AJAX Applications Scream on the Client
How to Make AJAX Applications Scream on the Client
 
CE344L-200365-Lab5.pdf
CE344L-200365-Lab5.pdfCE344L-200365-Lab5.pdf
CE344L-200365-Lab5.pdf
 
Re-Design with Elixir/OTP
Re-Design with Elixir/OTPRe-Design with Elixir/OTP
Re-Design with Elixir/OTP
 
Y1 gd engine_terminology ben comley-excell
Y1 gd engine_terminology ben comley-excellY1 gd engine_terminology ben comley-excell
Y1 gd engine_terminology ben comley-excell
 
virtualtouchscreen
virtualtouchscreenvirtualtouchscreen
virtualtouchscreen
 
Deep learning study 3
Deep learning study 3Deep learning study 3
Deep learning study 3
 
Advanced iOS Build Mechanics, Sebastien Pouliot
Advanced iOS Build Mechanics, Sebastien PouliotAdvanced iOS Build Mechanics, Sebastien Pouliot
Advanced iOS Build Mechanics, Sebastien Pouliot
 
Image Compression
Image CompressionImage Compression
Image Compression
 
Build Better Games with Unity and Microsoft Azure
Build Better Games with Unity and Microsoft AzureBuild Better Games with Unity and Microsoft Azure
Build Better Games with Unity and Microsoft Azure
 
New Features of SQL Server 2016
New Features of SQL Server 2016New Features of SQL Server 2016
New Features of SQL Server 2016
 
Synchronizing without internet - Multipeer Connectivity (iOS)
Synchronizing without internet - Multipeer Connectivity (iOS)Synchronizing without internet - Multipeer Connectivity (iOS)
Synchronizing without internet - Multipeer Connectivity (iOS)
 
lec1b.ppt
lec1b.pptlec1b.ppt
lec1b.ppt
 
Protractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsProtractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applications
 

Último

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 

Último (20)

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 

Metadata php

  • 1. [Tips] Membaca Metadata Image JPEG/TIFF dengan PHP PHP memiliki kemampuan membaca image / gambar. Dengan kemampuan itu tentu saja PHP mampu membaca data-data asal yang terdapat dalam image tersebut. Biasanya data tersebut dinamakan metadata. Proses pembacaan metadata itu cukup mudah, yaitu dengan memanfaatkan fungsi exif_read_data(). Misal saya memiliki sebuah gambar berekstensi JPEG dengan nama satu.JPEG, yang berasal dari hasil jepretan kamera digital. Maka data asal dari gambar tersebut dapat dibaca dengan perintah berikut : $data = exif_read_data('images/satu.jpg'); echo "< pre >"; print_r( $data ); echo "< /pre >"; Data yang muncul kira-kira seperti berikut: Array ( [FileName] => satu.jpg [FileDateTime] => 1335936620 [FileSize] => 5441417 [FileType] => 2 [MimeType] => image/jpeg [SectionsFound] => ANY_TAG, IFD0, THUMBNAIL, EXIF, INTEROP [COMPUTED] => Array ( [html] => width="4320" height="3240" [Height] => 3240 [Width] => 4320 [IsColor] => 1 [ByteOrderMotorola] => 0 [ApertureFNumber] => f/2.9
  • 2. [UserComment] => [UserCommentEncoding] => UNDEFINED [Copyright] => Copyright 2010 [Thumbnail.FileType] => 2 [Thumbnail.MimeType] => image/jpeg ) [ImageDescription] => [Make] => BenQ Corporation [Model] => DC C143X [Orientation] => 1 [XResolution] => 288/3 [YResolution] => 288/3 [ResolutionUnit] => 2 [Software] => 1.7600 [DateTime] => 2012:05:02 12:30:21 [YCbCrPositioning] => 2 [Copyright] => Copyright 2010 [Exif_IFD_Pointer] => 322 [THUMBNAIL] => Array ( [Compression] => 6 [Orientation] => 1 [XResolution] => 72/1 [YResolution] => 72/1 [ResolutionUnit] => 2 [JPEGInterchangeFormat] => 4290 [JPEGInterchangeFormatLength] => 7287 [YCbCrPositioning] => 2 ) [ExposureTime] => 1/279 [FNumber] => 29/10 [ExposureProgram] => 2 [ISOSpeedRatings] => 100 [ExifVersion] => 0220 [DateTimeOriginal] => 2012:05:02 12:30:21 [DateTimeDigitized] => 2012:05:02 12:30:21 [ComponentsConfiguration] => �
  • 3. [CompressedBitsPerPixel] => 500/100 [ShutterSpeedValue] => 8124/1000 [ApertureValue] => 3071/1000 [ExposureBiasValue] => 0/100 [MaxApertureValue] => 3171/1000 [MeteringMode] => 4 [LightSource] => 0 [Flash] => 24 [FocalLength] => 6300/1000 [MakerNote] => IP1:1 exp 130 agc: 95 cal_agc : 128 P2C : 16 . . . dan seterusnya. Hanya diambil sebagian karena cukup panjang. Pada bagian tersebut terlihat hampir semua properti pembuatan gambar tersebut. Antara lain dibuat kapan, dengan menggunakan kamera apa, ukuran berapa. Untuk keperluan programming biasanya hasil ini akan diatur dengan penguraian array lanjut. Antara lain kira-kira seperti berikut: $data = exif_read_data('images/satu.jpg'); foreach($data as $key=>$val) { if(is_array($val)) { foreach($val as $k=>$v) { echo $key."[$k]: $v<br />n"; } } else echo "$key: ".@substr($val,0,40)."<br />n"; } Hasilnya kira-kira akan seperti berikut: FileName: IMG_0495.JPG FileDateTime: 1335936620 FileSize: 5441417
  • 4. FileType: 2 MimeType: image/jpeg SectionsFound: ANY_TAG, IFD0, THUMBNAIL, EXIF, INTEROP COMPUTED[html]: width="4320" height="3240" COMPUTED[Height]: 3240 COMPUTED[Width]: 4320 COMPUTED[IsColor]: 1 COMPUTED[ByteOrderMotorola]: 0 COMPUTED[ApertureFNumber]: f/2.9 COMPUTED[UserComment]: COMPUTED[UserCommentEncoding]: UNDEFINED COMPUTED[Copyright]: Copyright 2010 COMPUTED[Thumbnail.FileType]: 2 COMPUTED[Thumbnail.MimeType]: image/jpeg ImageDescription: Make: BenQ Corporation Model: DC C143X Orientation: 1 XResolution: 288/3
  • 5. YResolution: 288/3 ResolutionUnit: 2 Software: 1.7600 DateTime: 2012:05:02 12:30:21 YCbCrPositioning: 2 Copyright: Copyright 2010 Exif_IFD_Pointer: 322 THUMBNAIL[Compression]: 6 THUMBNAIL[Orientation]: 1 THUMBNAIL[XResolution]: 72/1 THUMBNAIL[YResolution]: 72/1 THUMBNAIL[ResolutionUnit]: 2 THUMBNAIL[JPEGInterchangeFormat]: 4290 THUMBNAIL[JPEGInterchangeFormatLength]: 7287 THUMBNAIL[YCbCrPositioning]: 2 ExposureTime: 1/279 FNumber: 29/10 ExposureProgram: 2 ISOSpeedRatings: 100 ExifVersion: 0220
  • 6. DateTimeOriginal: 2012:05:02 12:30:21 DateTimeDigitized: 2012:05:02 12:30:21 ComponentsConfiguration: � CompressedBitsPerPixel: 500/100 ShutterSpeedValue: 8124/1000 ApertureValue: 3071/1000 ExposureBiasValue: 0/100 MaxApertureValue: 3171/1000 MeteringMode: 4 LightSource: 0 Flash: 24 FocalLength: 6300/1000 MakerNote: IP1:1 exp 130 agc: 95 cal_agc : 128 P2C UserComment: ���������������������������������������� SubSecTime: 0� FlashPixVersion: 0100 ColorSpace: 1 ExifImageWidth: 4320 ExifImageLength: 3240
  • 7. RelatedSoundFile: InteroperabilityOffset: 4260 FileSource: SceneType: ExposureMode: 0 WhiteBalance: 0 DigitalZoomRatio: 100/100 FocalLengthIn35mmFilm: 36 SceneCaptureType: 33 Contrast: 0 Saturation: 0 Sharpness: 0 InterOperabilityIndex: R98 InterOperabilityVersion: 0100 Dengan demikian, sebenarnya situs-situs fotografi, atau lomba fotografi akan dapat mengetahui bahwa sebenarnya gambar tersebut asli atau sudah ter-edit oleh software lain seperti potoshop dan lain sebagainya, meski ternyata metadata ini juga dapat dilakukan editing, yang akan kita pelajari dalam section lain. Ada yang berminat menjadi roy suryo moderen sebagai ahli metadata?? Silakan belajar lebih lanjut . Untuk exif_read_data, hanya dapat digunakan jenis file JPG dan TIFF. Anda juga dapat mengkombinasikan dengan form upload file. Sekian, semoga bermanfaat