1 /*
2 * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
251 * Standard/Document/ImageCreationTime after retrieving time from the text
252 * chunk. If there are multiple text chunks with creation time, the time
253 * retrieved from the last decoded text chunk will be used. A point to note
254 * is that, retrieval of time from text chunks is possible only if the
255 * encoded time in the chunk confirms to either the recommended RFC1123
256 * format or ISO format.
257 *
258 * Similarly, any update to Standard/Document/ImageCreationTime is reflected
259 * on the last decoded text chunk's data structure with time encoded in
260 * RFC1123 format. By updating the text chunk's data structure, we also
261 * ensure that PNGImageWriter will write image creation time on the output.
262 */
263 public boolean tEXt_creation_time_present;
264 private ListIterator<String> tEXt_creation_time_iter = null;
265 public static final String tEXt_creationTimeKey = "Creation Time";
266
267 // tRNS chunk
268 // If external (non-PNG sourced) data has red = green = blue,
269 // always store it as gray and promote when writing
270 public boolean tRNS_present;
271 public int tRNS_colorType; // PNG_COLOR_GRAY, _RGB, or _PALETTE
272 public byte[] tRNS_alpha; // May have fewer entries than PLTE_red, etc.
273 public int tRNS_gray;
274 public int tRNS_red;
275 public int tRNS_green;
276 public int tRNS_blue;
277
278 // zTXt chunk
279 public ArrayList<String> zTXt_keyword = new ArrayList<String>();
280 public ArrayList<Integer> zTXt_compressionMethod = new ArrayList<Integer>();
281 public ArrayList<String> zTXt_text = new ArrayList<String>();
282
283 // Unknown chunks
284 public ArrayList<String> unknownChunkType = new ArrayList<String>();
285 public ArrayList<byte[]> unknownChunkData = new ArrayList<byte[]>();
286
287 public PNGMetadata() {
288 super(true,
289 nativeMetadataFormatName,
290 nativeMetadataFormatClassName,
291 null, null);
|
1 /*
2 * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
251 * Standard/Document/ImageCreationTime after retrieving time from the text
252 * chunk. If there are multiple text chunks with creation time, the time
253 * retrieved from the last decoded text chunk will be used. A point to note
254 * is that, retrieval of time from text chunks is possible only if the
255 * encoded time in the chunk confirms to either the recommended RFC1123
256 * format or ISO format.
257 *
258 * Similarly, any update to Standard/Document/ImageCreationTime is reflected
259 * on the last decoded text chunk's data structure with time encoded in
260 * RFC1123 format. By updating the text chunk's data structure, we also
261 * ensure that PNGImageWriter will write image creation time on the output.
262 */
263 public boolean tEXt_creation_time_present;
264 private ListIterator<String> tEXt_creation_time_iter = null;
265 public static final String tEXt_creationTimeKey = "Creation Time";
266
267 // tRNS chunk
268 // If external (non-PNG sourced) data has red = green = blue,
269 // always store it as gray and promote when writing
270 public boolean tRNS_present;
271 public int tRNS_colorType = -1; // PNG_COLOR_GRAY, _RGB, or _PALETTE
272 public byte[] tRNS_alpha; // May have fewer entries than PLTE_red, etc.
273 public int tRNS_gray;
274 public int tRNS_red;
275 public int tRNS_green;
276 public int tRNS_blue;
277
278 // zTXt chunk
279 public ArrayList<String> zTXt_keyword = new ArrayList<String>();
280 public ArrayList<Integer> zTXt_compressionMethod = new ArrayList<Integer>();
281 public ArrayList<String> zTXt_text = new ArrayList<String>();
282
283 // Unknown chunks
284 public ArrayList<String> unknownChunkType = new ArrayList<String>();
285 public ArrayList<byte[]> unknownChunkData = new ArrayList<byte[]>();
286
287 public PNGMetadata() {
288 super(true,
289 nativeMetadataFormatName,
290 nativeMetadataFormatClassName,
291 null, null);
|