summaryrefslogtreecommitdiff
path: root/includes/jpeg_metadata_tk/documentation/jpeg.html
blob: 36a59a7a6f60338f65e475e4dbdcd1c7561fafed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
<html>
        <head>
                <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
                <link rel=StyleSheet href="style.css" type="text/css">
                <META NAME="keywords" CONTENT="JPEG Metadata Application Segments APP0 APP1 APP2 APP3 APP12 APP13 APP14 EXIF DCF XMP RDF Photoshop IRB IPTC DCMI JFIF">

                <title>The PHP JPEG Metadata Toolkit - Documentation</title>
        </head>

        <body>
                <div class="headerbar">
                        <H1 align="center" style="padding:15">The PHP JPEG Metadata Toolkit - Documentation</H1>
                </div>

                <a href="index.html">Go to Documentation - Home</a>

                <div class="maintext">

                <h2>JPEG &amp; Intrinsic JPEG Values Function Reference</h2>
                <p>
                        Functions for performing basic operations on a JPEG file
                </p>

                <br>
                <br>

                <table border cellpadding=8 cellspacing=0>
                        <tr>
                                <td width=1%>Function:</td>
                                <td colspan=2><b>get_jpeg_header_data</b></td>
                        </tr>
                        <tr>
                                <td>Description:</td>
                                <td colspan=2>
                                        Reads all the JPEG header segments from an JPEG image file into an array
                                </td>
                        <tr>
                        <tr>
                                <td>Parameters:</td>
                                <td width=1%>filename</td>
                                <td>the filename of the file to JPEG file to read</td>
                        </tr>
                        <tr>
                                <td rowspan=2>Returns:</td>
                                <td>headerdata</td>
                                <td>Array of JPEG header segments</td>
                        </tr>
                        <tr>
                                <td>FALSE</td>
                                <td>if headers could not be read</td>
                        </tr>
                </table>


                <br>
                <br>
                <br>
                <br>


                <table border cellpadding=8 cellspacing=0>
                        <tr>
                                <td width=1%>Function:</td>
                                <td colspan=2><b>put_jpeg_header_data</b></td>
                        </tr>
                        <tr>
                                <td>Description:</td>
                                <td colspan=2>
                                        Writes JPEG header data into a JPEG file. Takes an array in the
                                        same format as from get_jpeg_header_data, and combines it with
                                        the image data of an existing JPEG file, to create a new JPEG file<br>
                                        <br>
                                        <b>WARNING</b>: As this function will replace all JPEG headers,
                                        including SOF etc, it is best to read the jpeg headers
                                        from a file, alter them, then put them back on the same
                                        file. If a SOF segment wer to be transfered from one
                                        file to another, the image could become unreadable unless
                                        the images were idenical size and configuration
                                </td>
                        <tr>
                        <tr>
                                <td rowspan=3>Parameters:</td>
                                <td width=1%>old_filename</td>
                                <td>the JPEG file from which the image data will be retrieved</td>
                        </tr>
                        <tr>
                                <td width=1%>new_filename</td>
                                <td>the name of the new JPEG to create (can be same as old_filename)</td>
                        </tr>
                        <tr>
                                <td width=1%>jpeg_header_data</td>
                                <td>a JPEG header data array in the same format as from get_jpeg_header_data</td>
                        </tr>
                        <tr>
                                <td rowspan=2>Returns:</td>
                                <td>TRUE</td>
                                <td>on Success</td>
                        </tr>
                        <tr>
                                <td>FALSE</td>
                                <td>on Failure</td>
                        </tr>
                </table>


                <br>
                <br>
                <br>
                <br>


                <table border cellpadding=8 cellspacing=0>
                        <tr>
                                <td width=1%>Function:</td>
                                <td colspan=2><b>get_jpeg_Comment</b></td>
                        </tr>
                        <tr>
                                <td>Description:</td>
                                <td colspan=2>
                                        Retreives the contents of the JPEG Comment (COM = 0xFFFE) segment if one exists
                                </td>
                        <tr>
                        <tr>
                                <td rowspan=1>Parameters:</td>
                                <td width=1%>jpeg_header_data</td>
                                <td>the JPEG header data, as retrieved from the get_jpeg_header_data function</td>
                        </tr>
                        <tr>
                                <td rowspan=2>Returns:</td>
                                <td>string</td>
                                <td>Contents of the Comment segement</td>
                        </tr>
                        <tr>
                                <td>FALSE</td>
                                <td>if the comment segment couldnt be found</td>
                        </tr>
                </table>


                <br>
                <br>
                <br>
                <br>


                <table border cellpadding=8 cellspacing=0>
                        <tr>
                                <td width=1%>Function:</td>
                                <td colspan=2><b>Interpret_Comment_to_HTML</b></td>
                        </tr>
                        <tr>
                                <td>Description:</td>
                                <td colspan=2>
                                        Generates html showing the contents of any JPEG Comment segment
                                </td>
                        <tr>
                        <tr>
                                <td rowspan=1>Parameters:</td>
                                <td width=1%>jpeg_header_data</td>
                                <td>the JPEG header data, as retrieved from the get_jpeg_header_data function</td>
                        </tr>
                        <tr>
                                <td rowspan=1>Returns:</td>
                                <td>output</td>
                                <td>the HTML</td>
                        </tr>
                </table>


                <br>
                <br>
                <br>
                <br>


                <table border cellpadding=8 cellspacing=0>
                        <tr>
                                <td width=1%>Function:</td>
                                <td colspan=2><b>get_jpeg_intrinsic_values</b></td>
                        </tr>
                        <tr>
                                <td>Description:</td>
                                <td colspan=2>
                                        Retreives information about the intrinsic characteristics of the jpeg image, such as Bits per Component, Height and Width.
                                </td>
                        <tr>
                        <tr>
                                <td rowspan=1>Parameters:</td>
                                <td width=1%>jpeg_header_data</td>
                                <td>the JPEG header data, as retrieved from the get_jpeg_header_data function</td>
                        </tr>
                        <tr>
                                <td rowspan=2>Returns:</td>
                                <td>array</td>
                                <td>An array containing the intrinsic JPEG values</td>
                        </tr>
                        <tr>
                                <td>FALSE</td>
                                <td>if the comment segment couldnt be found</td>
                        </tr>
                </table>


                <br>
                <br>
                <br>
                <br>

                <table border cellpadding=8 cellspacing=0>
                        <tr>
                                <td width=1%>Function:</td>
                                <td colspan=2><b>Interpret_intrinsic_values_to_HTML</b></td>
                        </tr>
                        <tr>
                                <td>Description:</td>
                                <td colspan=2>
                                        Generates html showing some of the intrinsic JPEG values which were retrieved with the get_jpeg_intrinsic_values function
                                </td>
                        <tr>
                        <tr>
                                <td rowspan=1>Parameters:</td>
                                <td width=1%>values</td>
                                <td>the JPEG intrinsic values, as read from get_jpeg_intrinsic_values</td>
                        </tr>
                        <tr>
                                <td rowspan=1>Returns:</td>
                                <td>OutputStr</td>
                                <td>A string containing the HTML</td>
                        </tr>
                </table>


                <br>
                <br>
                <br>
                <br>


                <table border cellpadding=8 cellspacing=0>
                        <tr>
                                <td width=1%>Function:</td>
                                <td colspan=2><b>get_jpeg_image_data</b></td>
                        </tr>
                        <tr>
                                <td>Description:</td>
                                <td colspan=2>
                                        Retrieves the compressed image data part of the JPEG file
                                </td>
                        <tr>
                        <tr>
                                <td rowspan=1>Parameters:</td>
                                <td width=1%>filename</td>
                                <td>the filename of the JPEG file to read</td>
                        </tr>
                        <tr>
                                <td rowspan=2>Returns:</td>
                                <td>compressed_data</td>
                                <td>A string containing the compressed data</td>
                        </tr>
                        <tr>
                                <td>FALSE</td>
                                <td>if retrieval failed</td>
                        </tr>
                </table>


                <br>
                <br>
                <br>
                <br>


                <table border cellpadding=8 cellspacing=0>
                        <tr>
                                <td width=1%>Function:</td>
                                <td colspan=2><b>Generate_JPEG_APP_Segment_HTML</b></td>
                        </tr>
                        <tr>
                                <td>Description:</td>
                                <td colspan=2>
                                        Generates html showing information about the Application (APP) segments which are present in the JPEG file
                                </td>
                        <tr>
                        <tr>
                                <td rowspan=1>Parameters:</td>
                                <td width=1%>jpeg_header_data</td>
                                <td>the JPEG header data, as retrieved from the get_jpeg_header_data function</td>
                        </tr>
                        <tr>
                                <td rowspan=1>Returns:</td>
                                <td>output</td>
                                <td>A string containing the HTML</td>
                        </tr>
                </table>


                <br>
                <br>

                </div>

        </body>
</html>