SlideShare a Scribd company logo
[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

More Related Content

Viewers also liked

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)-602
sandralobo49
 
Case Parada - Prêmio Colunistas
Case Parada - Prêmio ColunistasCase Parada - Prêmio Colunistas
Case Parada - Prêmio Colunistas
Pedro Araújo
 
Conbinacion de correspondencias
Conbinacion de correspondenciasConbinacion de correspondencias
Conbinacion de correspondencias
shirleygm10
 
Liliana
LilianaLiliana
Liliana
luiisiito
 
The ciberbullying
The ciberbullyingThe ciberbullying
The ciberbullying
obeet666
 
virus en memoria USB
virus en memoria USBvirus en memoria USB
virus en memoria USB
cetis27ev
 
Poesiaren bidea
Poesiaren bideaPoesiaren bidea
Poesiaren bidea
sustatu
 
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
Dianna HM
 
Funcionamiento de notebook
Funcionamiento de notebookFuncionamiento de notebook
Funcionamiento de notebookstephanie407
 
Radiasi benda hitam
Radiasi benda hitamRadiasi benda hitam
Radiasi benda hitam
Nabila Arifannisa
 
Relatório julho - Quem se Importa
Relatório julho - Quem se ImportaRelatório julho - Quem se Importa
Relatório julho - Quem se Importa
GeneTatuapé
 
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
 

Viewers also liked (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
 

Similar to 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 Webcam
Intellovations, 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.js
Josh 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 Client
goodfriday
 
CE344L-200365-Lab5.pdf
CE344L-200365-Lab5.pdfCE344L-200365-Lab5.pdf
CE344L-200365-Lab5.pdf
UmarMustafa13
 
Re-Design with Elixir/OTP
Re-Design with Elixir/OTPRe-Design with Elixir/OTP
Re-Design with Elixir/OTP
Mustafa 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 3
San Kim
 
Advanced iOS Build Mechanics, Sebastien Pouliot
Advanced iOS Build Mechanics, Sebastien PouliotAdvanced iOS Build Mechanics, Sebastien Pouliot
Advanced iOS Build Mechanics, Sebastien PouliotXamarin
 
Image Compression
Image CompressionImage Compression
Image Compression
Paramjeet Singh Jamwal
 
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
Xamarin
 
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
 
lec1b.ppt
lec1b.pptlec1b.ppt
lec1b.ppt
RithikRaj25
 
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
Ludmila Nesvitiy
 

Similar to 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
 

Recently uploaded

LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 

Recently uploaded (20)

LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 

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