可用于在 OpenHarmony 应用中处理 XMP 元数据,提供属性、数组、结构体、限定符等的增删改查及本地化文本处理,支持多种数据类型,便于高效管理元数据信息。【此简介由AI生成】
| Files | Last commit | Last update |
|---|---|---|
| 9 months ago | ||
| 9 months ago | ||
| 9 months ago | ||
| 9 months ago | ||
| 9 months ago | ||
| 9 months ago | ||
| 9 months ago | ||
| 9 months ago | ||
| 9 months ago | ||
| 9 months ago | ||
| 9 months ago | ||
| 9 months ago | ||
| 9 months ago | ||
| 10 months ago | ||
| 10 months ago | ||
| 9 months ago |
@ohos/xmp_toolkit
Introduction
This library references the source code of the open-source software xmp_toolkit and implements related functionalities in TypeScript, providing a component for extracting XMP metadata from image, video, and audio files on OpenHarmony.
Download and Install
1. The installation command is as follows
ohpm install @ohos/xmp_toolkit
Instructions for Use
- Introduce file and code dependencies
import { XMPMetaFactory, XMPMeta, XMPPropertyInfo } from '@ohos/xmp_toolkit';
Interface list
| Interface | Function |
|---|---|
| XMPMeta.getProperty | Get attribute |
| XMPMeta.getArrayItem | Retrieve array items |
| XMPMeta.countArrayItems | Count the number of array items |
| XMPMeta.getStructField | Get structure field |
| XMPMeta.getQualifier | Get qualifiers |
| XMPMeta.getLocalizedText | Retrieve local text items |
| XMPMeta.getPropertyBoolean | Get Boolean attribute values |
| XMPMeta.getPropertyInteger | Get integer attribute value |
| XMPMeta.getPropertyLong | Get the value of a long integer attribute |
| XMPMeta.getPropertyDouble | Obtain dual precision attribute values |
| XMPMeta.getPropertyDate | Get date attribute value |
| XMPMeta.getPropertyCalendar | Get calendar attribute values |
| XMPMeta.getPropertyBase64 | Get Base64 attribute values |
| XMPMeta.getPropertyString | Retrieve string attribute values |
| XMPMeta.setProperty | Set properties |
| XMPMeta.setArrayItem | Set array items |
| XMPMeta.insertArrayItem | Insert array item |
| XMPMeta.appendArrayItem | Add array items |
| XMPMeta.setStructField | Set structure field |
| XMPMeta.setQualifier | Set qualifiers |
| XMPMeta.setLocalizedText | Set localized text |
| XMPMeta.setPropertyBoolean | Set Boolean properties |
| XMPMeta.setPropertyInteger | Set integer attribute |
| XMPMeta.setPropertyLong | Set long integer attribute |
| XMPMeta.setPropertyDouble | Set dual precision attribute |
| XMPMeta.setPropertyDate | Set date attribute |
| XMPMeta.setPropertyCalendar | Set calendar properties |
| XMPMeta.setPropertyBase64 | Set Base64 properties |
| XMPMeta.deleteProperty | Delete attribute |
| XMPMeta.deleteArrayItem | Delete array items |
| XMPMeta.deleteStructField | Delete structure field |
| XMPMeta.deleteQualifier | Remove qualifier |
| XMPMeta.doesPropertyExist | Determine whether the attribute exists |
| XMPMeta.doesArrayItemExist | Determine whether an array item exists |
| XMPMeta.doesStructFieldExist | Determine whether the structure field exists |
| XMPMeta.doesQualifierExist | Determine whether the qualifier exists |
| XMPMeta.iterator | Get Iterator |
| XMPMeta.getObjectName | Get object name |
| XMPMeta.setObjectName | Set object name |
| XMPMeta.getPacketHeader | Retrieve the original header text of the Packet |
| XMPMeta.normalize | Standardize the execution of the current model |
| XMPMeta.sort | Sort the entire data model |
| XMPMeta.dumpObject | Output the model in readable form |
| XMPMeta.clone | Deep copy |
| XMPSchemaRegistry.registerNameSpace | Register namespace |
| XMPSchemaRegistry.getNameSpacePrefix | Get namespace prefix |
| XMPSchemaRegistry.getNameSpaceURL | Get namespace URL |
| XMPSchemaRegistry.getNameSpaces | Get all namespaces |
| XMPSchemaRegistry.getPrefix | Get prefix |
| XMPSchemaRegistry.deleteNamespace | Delete namespace |
| XMPSchemaRegistry.resolveAlias | Analyze alias mapping |
| XMPSchemaRegistry.findAliases | Find all aliases |
| XMPSchemaRegistry.findAlias | Find specified alias |
| XMPSchemaRegistry.getAliases | Get all alias mappings |
| XMPiterator.skipSubtree | Skip the subtree of the current node |
| XMPiterator.skipSiblings | Skip the remaining sibling nodes of the current node |
| XMPDateTime.getYear | Get year |
| XMPDateTime.setYear | Set year |
| XMPDateTime.getMonth | Get Month |
| XMPDateTime.setMonth | Set month |
| XMPDateTime.getDay | Get Day |
| XMPDateTime.setDay | Set Day |
| XMPDateTime.getHour | Get hour |
| XMPDateTime.setHour | Set hour |
| XMPDateTime.getMinute | Get minute |
| XMPDateTime.setMinute | Set minute |
| XMPDateTime.getSecond | Get second |
| XMPDateTime.setSecond | Set second |
| XMPDateTime.getNanoSecond | Get nanoseconds |
| XMPDateTime.setNanoSecond | Set nanoseconds |
| XMPDateTime.getTimeZone | Get time zone |
| XMPDateTime.setTimeZone | Set time zone |
| XMPDateTime.getCalendar | Get calendar view |
| XMPDateTime.getISO8601String | Get ISO8601 string |
| XMPVersionInfo.getMajor | Get the main version number |
| XMPVersionInfo.getMinor | Get the secondary version number |
| XMPVersionInfo.getMicro | Get revision number |
| XMPVersionInfo.getBuild | Get Build Number |
| XMPVersionInfo.isDebug | Whether to adjust the version |
| XMPVersionInfo.getMessage | Get version description information |
| XMPMetaFactory.getSchemaRegistry | Get global singleton |
| XMPMetaFactory.create | Create an empty instance |
| XMPMetaFactory.parse | Analyze XMP |
| XMPMetaFactory.parseFromString | Parse from string |
| XMPMetaFactory.parseFromBuffer | Parse from byte array |
| XMPMetaFactory.serialize | Serialize to stream |
| XMPMetaFactory.serializeToBuffer | Serialize to byte array |
| XMPMetaFactory.serializeToString | Serialize to a string |
| XMPMetaFactory.reset | Reset global instance |
| XMPDateTimeFactory.createFromCalendar | Create XMPDateTime instance from calendar |
| XMPDateTimeFactory.create | Creation date and time |
| XMPDateTimeFactory.createFromISO8601 | Create from ISO8601 string |
| XMPDateTimeFactory.getCurrentDateTime | Get the current time |
| XMPDateTimeFactory.setLocalTimeZone | Set as local time zone |
| XMPDateTimeFactory.convertToUTCTime | Convert to UTC time |
| XMPDateTimeFactory.convertToLocalTime | Convert to local time |
| XMPPathFactory.composeArrayItemPath | Generate array path |
| XMPPathFactory.composeStructFieldPath | Generate structure field path |
| XMPPathFactory.composeQualifierPath | Generate qualifier path |
| XMPPathFactory.composeLangSelector | Generate language selector path |
| XMPPathFactory.composeFieldSelector | Generate field value selector path |
| XMPUtils.catenateArrayItems | Merge arrays into strings |
| XMPUtils.separateArrayItems | Split strings into arrays |
| XMPUtils.removeProperties | Batch delete attributes |
| XMPUtils.appendProperties | Additional attributes |
| XMPUtils.ConvertToBoolean | Convert string to boolean |
| XMPUtils.ConvertFromBoolean | Boolean to string conversion |
| XMPUtils.ConvertToInteger | Convert string to int |
| XMPUtils.ConvertFromInteger | Convert int to string |
| XMPUtils.ConvertToLong | Convert string to Long |
| XMPUtils.ConvertFromLong | Convert Long to a string |
| XMPUtils.ConvertToDouble | Convert string to Double |
| XMPUtils.ConvertFromDouble | Convert Double to String |
| XMPUtils.ConvertToDate | Convert string to Date |
| XMPUtils.ConvertFromDate | Convert Date to String |
| XMPUtils.encodeBase64 | Convert binary to Base64 |
| XMPUtils.decodeBase64 | Convert Base64 to binary |
| XMPException.getErrorCode | Get error code |
Regarding confusion
-
Code confusion, please reviewIntroduction to Code Confusion
-
If you want third-party libraries to remain unobfuscated during the code obfuscation process, you need to add corresponding exclusion rules to the obfuscation configuration file obfuscation-rules.txt.
-keep ./oh_modules/@ohos/xmp_toolkit
Constraints and limitations
Verified in the following version:
-
DevEco Studio: 6.0.1 release, SDK: API12 Release(5.0.0.66)
-
OpenHarmony SDK:API12 (5.0.0)
Directory Structure
|---- xmpToolkit
| |---- entry # Sample Code Folder
| |---- xmp_toolkit # xmp_toolkit library folder
| |----src/main #
| |----impl # Implement code folder using xmp interface
| |----options # Option interface implementation code folder
| |----properties # Attribute related interface real code folder
| |----Sample # Instance folder of calling xmp_toolkit interface in source library
| |---- README.MD # Installation and usage instructions
| |---- README_zh.MD # Chinese installation and usage instructions
Open source license
This project is based on Apache-2.0 License , Please enjoy and participate freely in open source.
Introduction
可用于在 OpenHarmony 应用中处理 XMP 元数据,提供属性、数组、结构体、限定符等的增删改查及本地化文本处理,支持多种数据类型,便于高效管理元数据信息。【此简介由AI生成】
Customize your domain