1 /*
2 * Copyright (c) 2005, 2016, 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
1267 dt);
1268 rootIFD.addTIFFField(f);
1269 }
1270
1271 child = child.getNextSibling();
1272 }
1273 } else if (name.equals("Text")) {
1274 Node child = node.getFirstChild();
1275 String theAuthor = null;
1276 String theDescription = null;
1277 String theTitle = null;
1278 while (child != null) {
1279 String childName = child.getNodeName();
1280 if(childName.equals("TextEntry")) {
1281 int tagNumber = -1;
1282 NamedNodeMap childAttrs = child.getAttributes();
1283 Node keywordNode = childAttrs.getNamedItem("keyword");
1284 if(keywordNode != null) {
1285 String keyword = keywordNode.getNodeValue();
1286 String value = getAttribute(child, "value");
1287 if(!keyword.equals("") && !value.equals("")) {
1288 if(keyword.equalsIgnoreCase("DocumentName")) {
1289 tagNumber =
1290 BaselineTIFFTagSet.TAG_DOCUMENT_NAME;
1291 } else if(keyword.equalsIgnoreCase("ImageDescription")) {
1292 tagNumber =
1293 BaselineTIFFTagSet.TAG_IMAGE_DESCRIPTION;
1294 } else if(keyword.equalsIgnoreCase("Make")) {
1295 tagNumber =
1296 BaselineTIFFTagSet.TAG_MAKE;
1297 } else if(keyword.equalsIgnoreCase("Model")) {
1298 tagNumber =
1299 BaselineTIFFTagSet.TAG_MODEL;
1300 } else if(keyword.equalsIgnoreCase("PageName")) {
1301 tagNumber =
1302 BaselineTIFFTagSet.TAG_PAGE_NAME;
1303 } else if(keyword.equalsIgnoreCase("Software")) {
1304 tagNumber =
1305 BaselineTIFFTagSet.TAG_SOFTWARE;
1306 } else if(keyword.equalsIgnoreCase("Artist")) {
1307 tagNumber =
|
1 /*
2 * Copyright (c) 2005, 2019, 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
1267 dt);
1268 rootIFD.addTIFFField(f);
1269 }
1270
1271 child = child.getNextSibling();
1272 }
1273 } else if (name.equals("Text")) {
1274 Node child = node.getFirstChild();
1275 String theAuthor = null;
1276 String theDescription = null;
1277 String theTitle = null;
1278 while (child != null) {
1279 String childName = child.getNodeName();
1280 if(childName.equals("TextEntry")) {
1281 int tagNumber = -1;
1282 NamedNodeMap childAttrs = child.getAttributes();
1283 Node keywordNode = childAttrs.getNamedItem("keyword");
1284 if(keywordNode != null) {
1285 String keyword = keywordNode.getNodeValue();
1286 String value = getAttribute(child, "value");
1287 if(!keyword.isEmpty() && !value.isEmpty()) {
1288 if(keyword.equalsIgnoreCase("DocumentName")) {
1289 tagNumber =
1290 BaselineTIFFTagSet.TAG_DOCUMENT_NAME;
1291 } else if(keyword.equalsIgnoreCase("ImageDescription")) {
1292 tagNumber =
1293 BaselineTIFFTagSet.TAG_IMAGE_DESCRIPTION;
1294 } else if(keyword.equalsIgnoreCase("Make")) {
1295 tagNumber =
1296 BaselineTIFFTagSet.TAG_MAKE;
1297 } else if(keyword.equalsIgnoreCase("Model")) {
1298 tagNumber =
1299 BaselineTIFFTagSet.TAG_MODEL;
1300 } else if(keyword.equalsIgnoreCase("PageName")) {
1301 tagNumber =
1302 BaselineTIFFTagSet.TAG_PAGE_NAME;
1303 } else if(keyword.equalsIgnoreCase("Software")) {
1304 tagNumber =
1305 BaselineTIFFTagSet.TAG_SOFTWARE;
1306 } else if(keyword.equalsIgnoreCase("Artist")) {
1307 tagNumber =
|