리자

[펌] JPEG EXIF 정보 얻는 함수(read_exif_data 사용 안함)

JPEG의 이미지 metadata 정보를 얻어오는 클래스 라이브러리 입니다.
PHP에서 제공하는 exif관련 함수를 전혀 사용하지 않고 hexData를 분석하여 추출해 내므로 별도의 EXIF 관련 외부 라이브러리를 설치하지 않으셔도 이용하실 수 있습니다.

사용하는 법은 아래와 같습니다.

<?php
$exif = new exif('image.jpg');

print_r($exif ->getImageInfo());
?>

exif::exif() 함수로 읽어올 이미지 파일을 설정한후
exif::getImageInfo() 함수로 해당 이미지의 EXIF 및 기타 모든 정보를 리턴받습니다.




- 클래스 설명
- exif class
*exif::exif("(string)파일경로", "(string)언어설정(en|ko)", "(boolen)디버그 정보 출력여부");
*exif::getImageInfo(void);


라이센스는 기본 MIT 을 따릅니다.
Copyright (c) 2010 M_FireFox

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:16:08 PHP & HTML에서 이동 됨]</div>

첨부파일

exif.php (28.2 KB) 22회 2010-09-30 22:03
|

댓글 5개

PHPINFO 에서 EXIF Support enabled 인 경우에는 exif_read_data() 함수를 사용하시면 됩니다.
http://sir.co.kr/bbs/board.php?bo_table=ds_free_image&wr_id=6011
위 링크의 이미지를 exif() 함수로 출력한 결과

Array
(
[format] => JPEG
[version] =>
[width] => 800
[height] => 533
[bpp] => 24
[alpha] =>
[exif] => Array
(
[Make] => Canon
[Model] => Canon EOS 450D
[Orientation] => 1
[XResolution] => 72
[YResolution] => 72
[ResolutionUnit] => 2
[Software] => Adobe Photoshop CS4 Windows
[DateTime] => 2010:09:23 21:21:45
[YCbCrPositioning] => 2
[ExifIFDPointer] => 220
[ExposureTime] => 0.025
[FNumber] => 20
[ExposureProgram] => 조리개 우선
[ISOSpeedRatings] => 200
[ExifVersion] => 0221
[DateTimeOriginal] => 2010:09:23 14:05:13
[DateTimeDigitized] => 2010:09:23 14:05:13
[ComponentsConfiguration] => Y
[ShutterSpeedValue] => 5.375
[ApertureValue] => 8.625
[ExposureBias] => 0.33333333333333
[MeteringMode] => 패턴
[Flash] => 강제 플래시 끔
[FocalLength] => 50
[UserComment] => Array
(
[0] => 0
[1] => 0
[2] => 0
[3] => 0
[4] => 0
[5] => 0
[6] => 0
[7] => 0
[8] => 0
[9] => 0
[10] => 0
[11] => 0
[12] => 0
[13] => 0
[14] => 0
[15] => 0
[16] => 0
[17] => 0
[18] => 0
[19] => 0
[20] => 0
[21] => 0
[22] => 0
[23] => 0
[24] => 0
[25] => 0
[26] => 0
[27] => 0
[28] => 0
[29] => 0
[30] => 0
[31] => 0
[32] => 0
[33] => 0
[34] => 0
[35] => 0
[36] => 0
[37] => 0
[38] => 0
[39] => 0
[40] => 0
[41] => 0
[42] => 0
[43] => 0
[44] => 0
[45] => 0
[46] => 0
[47] => 0
[48] => 0
[49] => 0
[50] => 0
[51] => 0
[52] => 0
[53] => 0
[54] => 0
[55] => 0
[56] => 0
[57] => 0
[58] => 0
[59] => 0
[60] => 0
[61] => 0
[62] => 0
[63] => 0
[64] => 0
[65] => 0
[66] => 0
[67] => 0
[68] => 0
[69] => 0
[70] => 0
[71] => 0
[72] => 0
[73] => 0
[74] => 0
[75] => 0
[76] => 0
[77] => 0
[78] => 0
[79] => 0
[80] => 0
[81] => 0
[82] => 0
[83] => 0
[84] => 0
[85] => 0
[86] => 0
[87] => 0
[88] => 0
[89] => 0
[90] => 0
[91] => 0
[92] => 0
[93] => 0
[94] => 0
[95] => 0
[96] => 0
[97] => 0
[98] => 0
[99] => 0
[100] => 0
[101] => 0
[102] => 0
[103] => 0
[104] => 0
[105] => 0
[106] => 0
[107] => 0
[108] => 0
[109] => 0
[110] => 0
[111] => 0
[112] => 0
[113] => 0
[114] => 0
[115] => 0
[116] => 0
[117] => 0
[118] => 0
[119] => 0
[120] => 0
[121] => 0
[122] => 0
[123] => 0
[124] => 0
[125] => 0
[126] => 0
[127] => 0
[128] => 0
[129] => 0
[130] => 0
[131] => 0
[132] => 0
[133] => 0
[134] => 0
[135] => 0
[136] => 0
[137] => 0
[138] => 0
[139] => 0
[140] => 0
[141] => 0
[142] => 0
[143] => 0
[144] => 0
[145] => 0
[146] => 0
[147] => 0
[148] => 0
[149] => 0
[150] => 0
[151] => 0
[152] => 0
[153] => 0
[154] => 0
[155] => 0
[156] => 0
[157] => 0
[158] => 0
[159] => 0
[160] => 0
[161] => 0
[162] => 0
[163] => 0
[164] => 0
[165] => 0
[166] => 0
[167] => 0
[168] => 0
[169] => 0
[170] => 0
[171] => 0
[172] => 0
[173] => 0
[174] => 0
[175] => 0
[176] => 0
[177] => 0
[178] => 0
[179] => 0
[180] => 0
[181] => 0
[182] => 0
[183] => 0
[184] => 0
[185] => 0
[186] => 0
[187] => 0
[188] => 0
[189] => 0
[190] => 0
[191] => 0
[192] => 0
[193] => 0
[194] => 0
[195] => 0
[196] => 0
[197] => 0
[198] => 0
[199] => 0
[200] => 0
[201] => 0
[202] => 0
[203] => 0
[204] => 0
[205] => 0
[206] => 0
[207] => 0
[208] => 0
[209] => 0
[210] => 0
[211] => 0
[212] => 0
[213] => 0
[214] => 0
[215] => 0
[216] => 0
[217] => 0
[218] => 0
[219] => 0
[220] => 0
[221] => 0
[222] => 0
[223] => 0
[224] => 0
[225] => 0
[226] => 0
[227] => 0
[228] => 0
[229] => 0
[230] => 0
[231] => 0
[232] => 0
[233] => 0
[234] => 0
[235] => 0
[236] => 0
[237] => 0
[238] => 0
[239] => 0
[240] => 0
[241] => 0
[242] => 0
[243] => 0
[244] => 0
[245] => 0
[246] => 0
[247] => 0
[248] => 0
[249] => 0
[250] => 0
[251] => 0
[252] => 0
[253] => 0
[254] => 0
[255] => 0
[256] => 0
[257] => 0
[258] => 0
[259] => 0
[260] => 0
[261] => 0
[262] => 0
[263] => 0
)

[SubsecTime] => 03
[SubsecTimeOriginal] => 03
[SubsecTimeDigitized] => 03
[FlashpixVersion] => 0100
[ColorSpace] => 1
[PixelXDimension] => 800
[PixelYDimension] => 533
[InteroperabilityIFDPointer] => 956
[FocalPlaneXResolution] => 2569.4760820046
[FocalPlaneYResolution] => 2575.3424657534
[FocalPlaneResolutionUnit] => 2
[CustomRendered] => Normal process
[ExposureMode] => 0
[WhiteBalance] => 자동
[SceneCaptureType] => 일반
)

)
http://sir.co.kr/bbs/board.php?bo_table=ds_free_image&wr_id=6011
위 링크의 이미지를 exif_read_data() 함수로 출력한 결과


Array
(
[FileName] => image.jpg
[FileDateTime] => 1285852662
[FileSize] => 164800
[FileType] => 2
[MimeType] => image/jpeg
[SectionsFound] => ANY_TAG, IFD0, THUMBNAIL, EXIF, INTEROP
[COMPUTED] => Array
(
[html] => width="800" height="533"
[Height] => 533
[Width] => 800
[IsColor] => 1
[ByteOrderMotorola] => 0
[CCDWidth] => 7mm
[ApertureFNumber] => f/20.0
[UserComment] =>
[UserCommentEncoding] => UNDEFINED
[Thumbnail.FileType] => 2
[Thumbnail.MimeType] => image/jpeg
)

[Make] => Canon
[Model] => Canon EOS 450D
[Orientation] => 1
[XResolution] => 720000/10000
[YResolution] => 720000/10000
[ResolutionUnit] => 2
[Software] => Adobe Photoshop CS4 Windows
[DateTime] => 2010:09:23 21:21:45
[YCbCrPositioning] => 2
[Exif_IFD_Pointer] => 220
[THUMBNAIL] => Array
(
[Compression] => 6
[XResolution] => 72/1
[YResolution] => 72/1
[ResolutionUnit] => 2
[JPEGInterchangeFormat] => 1082
[JPEGInterchangeFormatLength] => 6141
)

[ExposureTime] => 1/40
[FNumber] => 20/1
[ExposureProgram] => 3
[ISOSpeedRatings] => 200
[ExifVersion] => 0221
[DateTimeOriginal] => 2010:09:23 14:05:13
[DateTimeDigitized] => 2010:09:23 14:05:13
[ComponentsConfiguration] =>
[ShutterSpeedValue] => 352256/65536
[ApertureValue] => 565248/65536
[ExposureBiasValue] => 1/3
[MeteringMode] => 5
[Flash] => 16
[FocalLength] => 50/1
[UserComment] =>
[SubSecTime] => 03
[SubSecTimeOriginal] => 03
[SubSecTimeDigitized] => 03
[FlashPixVersion] => 0100
[ColorSpace] => 1
[ExifImageWidth] => 800
[ExifImageLength] => 533
[InteroperabilityOffset] => 956
[FocalPlaneXResolution] => 2256000/878
[FocalPlaneYResolution] => 1504000/584
[FocalPlaneResolutionUnit] => 2
[CustomRendered] => 0
[ExposureMode] => 0
[WhiteBalance] => 0
[SceneCaptureType] => 0
[InterOperabilityIndex] => R98
[InterOperabilityVersion] => 0100
)
잘 보았네요..
감사합니다. 완전 좋은 정보네요.
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
15년 전 조회 1,563
15년 전 조회 1,835
15년 전 조회 1,204
15년 전 조회 1,117
15년 전 조회 1,286
15년 전 조회 1,335
15년 전 조회 1,138
15년 전 조회 1,426
15년 전 조회 1,507
15년 전 조회 1,422
15년 전 조회 3,348
15년 전 조회 997
15년 전 조회 1,573
15년 전 조회 1,158
15년 전 조회 1,970
15년 전 조회 928
15년 전 조회 1,082
15년 전 조회 1,086
15년 전 조회 1,100
15년 전 조회 1,831
15년 전 조회 3,156
15년 전 조회 2,236
15년 전 조회 2,126
15년 전 조회 1,114
15년 전 조회 1,223
15년 전 조회 1,162
15년 전 조회 1,044
15년 전 조회 1,340
15년 전 조회 1,047
15년 전 조회 1,494
15년 전 조회 934
15년 전 조회 848
15년 전 조회 1,721
15년 전 조회 987
15년 전 조회 1,424
15년 전 조회 1,296
15년 전 조회 965
15년 전 조회 998
15년 전 조회 893
15년 전 조회 882
15년 전 조회 1,054
15년 전 조회 1,299
15년 전 조회 2,475
15년 전 조회 1,068
15년 전 조회 1,157
15년 전 조회 1,188
15년 전 조회 1,192
15년 전 조회 1,263
15년 전 조회 874
15년 전 조회 2,128
15년 전 조회 987
15년 전 조회 1,797
15년 전 조회 925
15년 전 조회 935
15년 전 조회 1,596
15년 전 조회 1,213
15년 전 조회 1,512
15년 전 조회 1,828
15년 전 조회 1,453
15년 전 조회 1,549
15년 전 조회 928
15년 전 조회 2,469
15년 전 조회 1,203
15년 전 조회 925
15년 전 조회 1,287
15년 전 조회 989
15년 전 조회 2,242
15년 전 조회 1,284
15년 전 조회 1,095
15년 전 조회 1,185
15년 전 조회 1,153
15년 전 조회 1,175
15년 전 조회 1,234
15년 전 조회 746
15년 전 조회 680
15년 전 조회 653
15년 전 조회 1,343
15년 전 조회 1,146
15년 전 조회 989
15년 전 조회 983
15년 전 조회 1,382
15년 전 조회 3,413
15년 전 조회 1,279
15년 전 조회 2,079
15년 전 조회 1,321
15년 전 조회 1,162
15년 전 조회 2,826
15년 전 조회 1,796
15년 전 조회 2,692
15년 전 조회 2,816
15년 전 조회 1,547
15년 전 조회 1,240
15년 전 조회 1,730
15년 전 조회 1,146
15년 전 조회 1,441
15년 전 조회 1,324
15년 전 조회 1,731
15년 전 조회 1,889
15년 전 조회 1,138
15년 전 조회 1,566