- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在尝试修改 PHP_JPEG_Metadata_Toolkit 中的代码这样我就可以使用 PHP 为 jpeg 文件正确读取和写入 XMP 数据。目前,由于 XMP block ,jpeg 文件(当由工具包保存时)在 Adobe Photoshop & Bridge 中会出错。
我可以通过两种方式查看 Photoshop 使用的 XMP RDF 模式。第一个是 Photoshop 在 jpg 中实际保存的内容以及我正在导入的内容。 Photoshop 对所有内容使用单个 rdf:Description block 。它在 block 本身内抛出许多模式标识符(url),并为许多元数据字段添加值。接下来是 Dublin Core、Photoshop、Iptc4xmpCore 等的标签 block ,但都集中在一个 Description 标签中。
第二个是在 XMP documentation 之后显示在 Photoshop“文件信息”中的格式整齐的元数据。对于 RDF(声明“按照惯例,来自给定模式的所有属性,并且只有该模式,在单个 rdf:Description 元素中列出。”)
按照 Photoshop 实际发送的示例(所有内容都在一个 rdf:Description 下),我已经能够解决 Photoshop 在使用 Toolkit 编辑时出现错误的问题
两个问题:知道为什么 Photoshop 保存的 XMP 元数据与它在程序中显示的不同吗?而且……为什么我要花时间将我的输出格式化为 RDF 规范,当它在一个 rdf:Description 中混杂在一起时工作得很好?我不熟悉所有这些工作,所以任何指导将不胜感激。
这些示例经过编辑,因此您可以更轻松地仅看到格式差异 - 请原谅两者之间因编辑而产生的内容差异。
这是我实际从 Photoshop 收到的内容(已编辑):
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#"
xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#"
xmlns:xmp="http://ns.adobe.com/xap/1.0/"
xmlns:xmpRights="http://ns.adobe.com/xap/1.0/rights/"
xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/"
xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmpMM:DocumentID="xmp.did:8808E8B6139411E3A70AB29CEEC8FF6C"
xmpMM:InstanceID="xmp.iid:0071BBEF4517E311BCBCC2DF868D188C"
xmpMM:OriginalDocumentID=""
xmp:CreatorTool="(PHP JPEG Metadata Toolkit v1.12)"
xmp:MetadataDate="2013-09-06T15:44:49-07:00"
xmp:ModifyDate="2013-09-06T15:44:49-07:00"
xmp:CreateDate="2013-09-06T15:22:46-07:00"
xmpRights:Marked="True"
xmpRights:WebStatement="MY WEB ADDRESS"
Iptc4xmpCore:IntellectualGenre=""
photoshop:Instructions="OOOInstructions"
photoshop:Headline="OOOHeadline"
photoshop:CaptionWriter="MY NAME"
dc:format="image/jpeg">
<xmpMM:DerivedFrom stRef:instanceID="6B5F4850BB0819F254E40401F67ACAC9"
<stRef:documentID="6B5F4850BB0819F254E40401F67ACAC9"/>
<xmpRights:UsageTerms>
<rdf:Alt>
<rdf:li xml:lang="x-default">MY INFO HERE</rdf:li>
</rdf:Alt>
</xmpRights:UsageTerms>
<dc:description>
<rdf:Alt>
<rdf:li xml:lang="x-default">OOODescription
</rdf:li>
</rdf:Alt>
</dc:description>
</rdf:Description>
</rdf:RDF>
这是 Photoshop 格式精美的 View (已编辑)
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#"
xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#">
<xmpMM:DocumentID>xmp.did: … ETC…</xmpMM:DocumentID>
<xmpMM:InstanceID>xmp.iid: …ETC… </xmpMM:InstanceID>
<xmpMM:OriginalDocumentID/>
<xmpMM:DerivedFrom rdf:parseType="Resource">
<stRef:instanceID>6B5F4850BB0819F254E40401F67ACAC9</stRef:instanceID>
<stRef:documentID>6B5F4850BB0819F254E40401F67ACAC9</stRef:documentID>
</xmpMM:DerivedFrom>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:xmp="http://ns.adobe.com/xap/1.0/">
<xmp:CreatorTool>Adobe Photoshop CS6 (Windows)</xmp:CreatorTool>
<xmp:MetadataDate>2013-09-06T15:44:49-07:00</xmp:MetadataDate>
<xmp:ModifyDate>2013-09-06T15:44:49-07:00</xmp:ModifyDate>
<xmp:CreateDate>2013-09-06T15:22:46-07:00</xmp:CreateDate>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:xmpRights="http://ns.adobe.com/xap/1.0/rights/">
<xmpRights:Marked>True</xmpRights:Marked>
<xmpRights:WebStatement>MY WEB ADDRESS</xmpRights:WebStatement>
<xmpRights:UsageTerms>
<rdf:Alt>
<rdf:li xml:lang="x-default">MY INFO HERE</rdf:li>
</rdf:Alt>
</xmpRights:UsageTerms>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/">
<Iptc4xmpCore:IntellectualGenre/>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/">
<photoshop:Instructions>OOOInstructions</photoshop:Instructions>
<photoshop:Headline>OOOHeadline</photoshop:Headline>
<photoshop:CaptionWriter>OOO </photoshop:CaptionWriter>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:format>image/jpeg</dc:format>
<dc:description>
<rdf:Alt>
<rdf:li xml:lang="x-default">OOODescription</rdf:li>
</rdf:Alt>
</dc:description>
</rdf:Description>
</rdf:RDF>
编辑我很欣赏约书亚的解释。我觉得有趣/奇怪的是,似乎有两种不同的方式来列出一个值。第一个是等号,如 tag="value"并包含在 rdf:Description 括号内(注意关闭 rdf:Description 括号):
<rdf:Description rdf:about=""
xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/" xmpRights:Marked="True"
photoshop:Instructions="Notice closing Bracket here">
</rdf:Description>
第二个是值(value)
<rdf:Description rdf:about=""
xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/">
<photoshop:Instructions>OOOInstructions</photoshop:Instructions>
</rdf:Description>
最佳答案
看起来 Photoshop 正在做的是读取一些数据的有效、格式良好的 RDF/XML 序列化,然后以另一个有效、格式良好的 RDF/XML 序列化将其显示回 UI 中的用户遵循一些额外的约定。
RDF 是一种基于图形的数据表示。 RDF 中的基本知识是三元组,也称为语句。每个三元组都有一个主语、一个谓语和一个宾语。主语、谓语和宾语都可以是 IRI 引用;主题和对象也可以是空白节点,对象也可以是文字(例如,字符串)。 RDF/XML 是 RDF 的一种特殊序列化。 RDF/XML 片段:
<rdf:Description rdf:about="" xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/">
<photoshop:Instructions>OOOInstructions</photoshop:Instructions>
<photoshop:Headline>OOOHeadline</photoshop:Headline>
<photoshop:CaptionWriter>OOO </photoshop:CaptionWriter>
</rdf:Description>
包含三个三元组:
<this-document> <http://ns.adobe.com/photoshop/1.0/Instructions> "OOOInstructions"
<this-document> <http://ns.adobe.com/photoshop/1.0/Headline> "OOOHeadline"
<this-document> <http://ns.adobe.com/photoshop/1.0/CaptionWriter> "OOO "
哪里<this-document>
是解析引用 ""
的结果(rdf:about
属性的值。(XMP 文档的第 21 页说 rdf:about
属性的值可能是一个空字符串……,这意味着 XMP 在物理上对于所描述的资源是本地的。应用程序必须依靠文件格式的知识将 XMP 与资源正确关联。)
做
<rdf:Description rdf:about=""
xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/">
<Iptc4xmpCore:IntellectualGenre/>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/">
<photoshop:Instructions>OOOInstructions</photoshop:Instructions>
<photoshop:Headline>OOOHeadline</photoshop:Headline>
<photoshop:CaptionWriter>OOO </photoshop:CaptionWriter>
</rdf:Description>
和做的完全一样
<rdf:Description rdf:about=""
xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/"
xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/">
<Iptc4xmpCore:IntellectualGenre/>
<photoshop:Instructions>OOOInstructions</photoshop:Instructions>
<photoshop:Headline>OOOHeadline</photoshop:Headline>
<photoshop:CaptionWriter>OOO </photoshop:CaptionWriter>
</rdf:Description>
它们序列化同一组三元组。两者都不是无效或不正确的。这只是你喜欢哪个的问题。其他变化也是可能的。例如,在某些情况下,您可以使用元素属性来指示属性值。三元组:
<this-document> <http://ns.adobe.com/photoshop/1.0/Instructions> "OOOInstructions"
可以使用元素序列化,如 Section 2.2 Node Elements and Property Elements 中所述RDF/XML 推荐标准:
<rdf:Description rdf:about="" xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/">
<photoshop:Instructions>OOOInstructions</photoshop:Instructions>
</rdf:Description>
或使用属性来指示属性值,如 Section 2.5 Property Attributes 中所述同一份文件:
<rdf:Description rdf:about="" xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"
photoshop:Instructions="OOOInstructions">
</rdf:Description>
那么,关于你的第二个问题:
Why should I spend the time to format my output to the RDF specs when it works nicely all jumbled together in a single rdf:Description?
如果输出应该是 RDF 格式,您应该使其成为有效的 RDF。它是否采用特定的审美令人愉悦的格式是一个完全不同的问题。这两者之间的转换相对容易,我希望 Photoshop 正在做的是读取 RDF 的 blob,因为它应该(即不依赖于 XML 序列化的任何特定结构,因为它并不总是相同的(例如, you shouldn't try to manipulate RDF with XPath )) 然后以用户认为合适的方式为用户格式化该数据,即您提到的约定。
如果您还没有这样做,我非常强烈建议您使用 PHP 中的 RDF 库来构建元数据图,而不是尝试手动构建 RDF/XML 序列化。 p>
注意:这是基于文档的更新。 根据 the documentation , page 19,XMP只支持RDF的一个子集,所以上面和问题中的RDF虽然适合作为RDF,但是否适合作为XMP,仍然是一个有意义的问题。然而,同样来自第 19 页:
The sections below describe the high-level structure of XMP data in an XMP Packet:
- The outermost element is optionally an x:xmpmeta element
- It contains a single rdf:RDF element
- which in turn contains one or more rdf:Description elements
- each of which contains one or more XMP Properties.
第 20 页包含一些关于 rdf:Description
的详细说明元素(重点添加):
The rdf:RDF element can contain one or more rdf:Description elements. … By convention, all properties from a given schema, and only that schema, are listed within a single rdf:Description element. (This is not a requirement, just a means to improve readability.)
特别强调的部分是我们需要的,以便得出我们在上面看到的两种形式都可以接受的结论。只创建一个大 blob 可能更容易,如果其他工具可以为您将其拆分为常规形式,您会觉得自己很幸运。
关于php - 在 jpeg 中写入 XMP 元数据(使用 PHP)- 使用单个或多个 rdf :Description blocks,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18668132/
最终目标:我想要由 Git 跟踪的文件,但让这些文件对于所有分支都是相同的版本。如果您使用 gitignore 文件,则所有分支的文件都是相同的,但不幸的是不会被跟踪。当我跑 git push或类似的
我想从 PDF 文件中删除元数据。我已经尝试使用“exiftool”、“pdftk”和“qpdf”来删除元数据(建议的方法 - https://gist.github.com/hubgit/60783
AWS EC2 元数据从 EC2 提供了有关其自身的必要信息(废话!) - 是否有任何与 lambda 等效的信息。 我了解与 EC2 不同的 lambda 函数的 Multi-Tenancy 和短期
我正在使用 libavformat(即 C 库)将 MPEG4/H264 编码为 mp4 文件,我想在 MP4 文件中添加一些元数据,例如日期/时间。有人可以告诉我如何做到这一点吗? 谢谢。 最佳答案
有谁知道任何允许从 .jpg 图像中提取 java 元数据的类?或者可能是一些有用的代码? 谢谢! 最佳答案 我维护着一个库,正是这样做的。 https://github.com/drewnoakes
我尝试找出如何从媒体获取元数据有一段时间了,但到目前为止没有任何效果。我有类 Song,其中有 SimpleStringProperties,如标题、艺术家等。我尝试在类构造函数中为它们设置值: pr
我已经多次遇到这个问题,并且从不喜欢所选择的解决方案。假设您在数据库中有一个状态列表(作为一个简单的示例)。在您的代码隐藏中,您希望能够通过 ID 引用状态并通过 Intellisense 获得状态列
我在我的应用程序中使用 google 登录并从 google 获取用户个人资料信息。 我已经测试过,它在我这边工作正常,但苹果拒绝了它。我没有发现任何错误。 苹果拒绝原因:“Verify is you
我正在开发一个基于 MySQL 数据库的 Web 应用程序。我需要收集和分析使用情况和性能统计数据。统计数据将针对非技术人员。 如何实现此功能?您应该将我的问题视为编程问题,但如果您知道合适的工具或扩
我对如何保存表格行的元数据有疑问。 例如,我有一个表,其中包含有关图像 items_images 的数据。编号,整数(20)标题,VARCHAR(255)添加日期,DATETIME... 现在我想添加
我不明白为什么我必须在 list 中使用两个元数据元素才能开始运行我的 Google Maps API v2 项目。这些标签的用途是什么? 最佳答案 元数据是指有关数据的数据。 关于java -
如何获取 SharePoint 文档库中项目的内容类型列或元数据? 此链接提供了我不需要的文件属性 http://msdn.microsoft.com/en-us/library/microsoft.
我很确定这是可能的,只是不确定它的术语是什么以及如何去做。基本上,如果您右键单击任何文件并转到属性,然后转到摘要,您可以向文件添加评论等。 我想知道的是,您将如何从 C# 中有问题地执行此操作。此外,
在我的应用程序中,我正在从 Assets 库中检索 UIImage,该图像具有元数据。然后,该应用程序会调整图像大小并旋转图像,从而创建新图像。新图像没有预期的原始元数据,但如何在上传前将元数据添加回
Java 通过JDBC获得连接以后,得到一个Connection 对象,可以从这个对象获得有关数据库管理系统的各种信息,包括数据库中的各个表,表中的各个列,数据类型,触发器,存储过程等各方面的信息。
想知道是否有人知道扩展或配置 Breeze 以便服务器返回实体元数据中的附加信息的任何方法?我想使用这些附加数据来协助验证。 假设我有一个应用了一些数据注释的实体模型: public class Pe
我正在寻找将 MEF 用于我正在构建的应用程序的插件系统。我希望每个组件在(GUID)上都有一个我希望能够查找的标识符。但是,此 ID 在处理导出部件时也很有用。 有没有一种方法可以让我在导出的部分上
我对不完整的视频有疑问。例如上传失败的视频。如果您使用 ffmpeg -i 检查其元数据您将获得 1 小时的持续时间,但实际上只有 10mb 已上传到服务器,实际持续时间约为 7 分钟。查找这些视频
我在使用 FFmpeg 覆盖视频文件上的元数据时遇到了一些问题,这些文件之前已经添加了元数据(FFmpeg 也添加了以前的元数据)。 所以我使用ffmpeg -i path/to/video file
我有两个项目组想要加入: A B 使用常规连接会给我一个包含 4 个项目的集合: ServerA with Metadata A; ServerB with Metad
我是一名优秀的程序员,十分优秀!