Professional Documents
Culture Documents
A small but growing number of Photoshop users have been noticing and complaining of excessive,
bloated file sizes with certain files saved from Photoshop. In most cases, this is due to Photoshop
specific metadata known as photoshop:DocumentAncestors being written to the file.
This metadata is added as a record of copy/paste or placed document ID entries. Generally, this
metadata is small and does not greatly impact the file size of Photoshop or other file formats
containing this historical metadata. However, some users have reported files with excessive amounts
of this metadata. What is considered excessive? Metadata does not add that much to file size, does
it? Well in some cases 100,000 lines of photoshop:DocumentAncestors metadata has been
found! A 65mb file may be reduced to 110kb once this metadata has been removed.
How do you know if your files have this metadata? One way is to use Adobe Bridge’s “Find”
command or the related “Smart Collections” feature can be used to search file metadata for the
keywords – photoshop:DocumentAncestors
Photoshop does offer Export and Export/Save for Web options that do feature the ability to
strip metadata from saved files.For many users, these standard options make sense and work as
required. However for other users, final file formats, colour modes, bit depth and other factors may
rule out the use of these “internet” based export options. These users need alternatives.
Adobe don’t offer a Photoshop preference option to turn this specific metadata
on/off. Therefore many end users have had to find their own solutions to this problem.
// https://forums.adobe.com/message/8511978#8511978
function deleteDocumentAncestorsMetadata() {
whatApp = String(app.name);//String version of the app name
if(whatApp.search("Photoshop") > 0) { //Check for photoshop
specifically, or this will cause errors
//Function Scrubs Document Ancestors from Files
if(!documents.length) {
alert("There are no open documents. Please open a file to run
this script.")
return;
}
if (ExternalObject.AdobeXMPScript == undefined)
ExternalObject.AdobeXMPScript = new
ExternalObject("lib:AdobeXMPScript");
var xmp = new XMPMeta( activeDocument.xmpMetadata.rawData);
// Begone foul Document Ancestors!
xmp.deleteProperty(XMPConst.NS_PHOTOSHOP,
"DocumentAncestors");
app.activeDocument.xmpMetadata.rawData = xmp.serialize();
}
}
//Now run the function to remove the document ancestors
deleteDocumentAncestorsMetadata();
This script will remove the photoshop:DocumentAncestors metadata from an open file. It is best
used with the Photoshop “Script Events Manager” – triggered on key events such as Opening,
Saving or Exporting a document. Running the script via the Script Events Manager automates the
process of removing this metadata (File > Scripts > Script Events Manager). I am not aware of a
method to “threshold” the removal at a specific number of entries, all of the
photoshop:DocumentAncestors metadata will be removed, whether potentially useful or
excessive! Use at your own risk.
Solution #2: Adobe Bridge Script (not for use with PNG images)
// https://forums.adobe.com/thread/2340460
//#target bridge // let EntendScript know what app the script is for
clearDocumentAncestors = {};// create an object
clearDocumentAncestors.execute = function(){// create a method for
that object
var sels = app.document.selections;// store the array of selected
files
for (var i = 0; i < sels.length; i++){//loop though that array
var md = sels[i].synchronousMetadata;// get the metadata for the
file
md.namespace = "http://ns.adobe.com/photoshop/1.0/";// set the
namespace
md.DocumentAncestors = "";
}
app.document.chooseMenuItem("Rotate90CW");
app.document.chooseMenuItem("Rotate90CCW");
};
//refresh cache
// app.document.chooseMenuItem("PurgeCacheForSelected");
// this script only works in bridge
if (BridgeTalk.appName == "bridge"){
//creage the munuItem
var menu = MenuElement.create( "command", "Clear DocumentAncestors
in metadata", "at the end of Tools");
menu.onSelect = clearDocumentAncestors.execute;
};
The Adobe Bridge script is useful for JPEG or other images saved with lossy compression, as only
the metadata is removed without requiring the image data to be decompressed/recompressed. This
script may not work in Bridge CS6, however it does appear to work in various versions of Bridge
CC. Use at your own risk.
Once a PDF has been created from images bloated with excessive photoshop:DocumentAncestors
metadata, the object level metadata is no longer accessible to Adobe Bridge or ExifTool (so the
previous solutions will not work on PDF files). One has to use a brute force approach in Acrobat Pro
to remove all object level metadata: Print Production Tools > Preflight > Single Fixups >
Document Info and Metadata > Remove all object level XMP metadata.
Another option is to use the “Save as Optimised PDF” option, with the “Discard User Data
– Discard document information and metadata” option checked/ticked.
This Photoshop script will process a source folder containing JPEG/TIFF/PSD files and remove the
photoshop:DocumentAncestors metadata without opening the images into Photoshop. Use at your
own risk.
// https://forums.adobe.com/message/9671488#9671488
#target photoshop;
var inputFolder= Folder.selectDialog ("Please select folder to
process");
if(inputFolder != null){
var fileList = inputFolder.getFiles(/\.(jpg|tif|psd)$/i);
for(var a in fileList){delFileAncestorsMeta(fileList[a]);}
}
function delFileAncestorsMeta(selectedFile) {
if (ExternalObject.AdobeXMPScript == undefined)
ExternalObject.AdobeXMPScript = new
ExternalObject("lib:AdobeXMPScript");
var xmpFile = new XMPFile( selectedFile.fsName, XMPConst.FILE_UNKNOWN,
XMPConst.OPEN_FOR_UPDATE | XMPConst.OPEN_USE_SMART_HANDLER );
var xmp = xmpFile.getXMP();
xmp.deleteProperty(XMPConst.NS_PHOTOSHOP, "DocumentAncestors");
if (xmpFile.canPutXMP(xmp)) {
xmpFile.putXMP(xmp);
xmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
}
};
When image files with excessive photoshop:DocumentAncestors metadata are placed into Adobe
InDesign, the native InDesign file will also bloat with this unwanted metadata. Once bloated images
have been “cleaned” and their links updated in InDesign, simply re-saving the .indd file will not
decrease the already bloated file size! A “Save as” is required to clear out the redundant metadata
from the initial placement. Note: This “Save as” step to “tidy up” a file's data was also used by
InDesign’s predecessor – Adobe PageMaker and is also used in Adobe Acrobat Pro.
Fixed issues in Photoshop CC, January 2019 (version 20.0.2) release: The raw metadata for some
Photoshop files has excessive number of entries of 'photoshop:DocumentAncestors’
https://helpx.adobe.com/photoshop/kb/fixed-issues.html
Downloading and Installing Adobe Scripts
Downloading JavaScript Files
Many scripts are offered in .js or .jsx or even .jsxbin formats. Simply download these files ready for
installation (in some cases they may need to be decompressed from a .zip format archive).
Some scripts are offered as “source code”, rather than saved into a ready to use file. This is often the
case with scripts found at the Adobe User Forums, GitHub, SourceForge etc. Simply select and
copy/paste the script code into a plain text document, saving the file with a .jsx filename extension.
Ensure that a double extension is not incorrectly added, such as .jsx.txt
NOTE: Only paste the source code into plain text editors such as Notepad or Adobe ExtendScript
Toolkit (WordPad or MS Word are not plain text editors). Ensure that straight single or straight
double-quote marks " do not become curly “.
Adobe Bridge JavaScript source code from GitHub – use the “Raw” button and then save the following page as .jsx
Saving & Compiling AppleScript Source Code
AppleScript code must be compiled using the icon indicated (or using the Script > Compile menu)
Although AppleScript source code is plain text, unlike JavaScript it must be “compiled” before it can
be used. Further information at the Apple Developer site:
https://developer.apple.com/library/content/documentation/LanguagesUtilities/Conceptual/MacAuto
mationScriptingGuide/CreateaScript.html
https://developer.apple.com/library/content/documentation/AppleScript/Conceptual/AppleScriptX/C
oncepts/work_with_as.html#//apple_ref/doc/uid/TP40001568-1152365
Mac OS Example:
NOTE: If running, Adobe Bridge must be quit and restarted for newly added scripts to become
accessible.
Mac OS Example:
NOTE: If running, Adobe InDesign will load newly added scripts without having to quit and restart
the application. Scripts can be sorted and stored into operating system sub-folders, which will be
reflected in the script panel interface.
Mac OS Example:
Win OS Example:
Alternatively, select File > Scripts > Browse, and navigate to the script file.
NOTE: If running, Adobe Photoshop must be quit and restarted for newly added scripts to become
accessible.
Mac OS Example:
Win OS Example:
C:\Program Files\Adobe\Adobe Illustrator CC 2018\Presets\Scripts
Alternatively, select File > Scripts > Other Script, and navigate to the script file.
NOTE: If running, Adobe Illustrator must be quit and restarted for newly added scripts to become
accessible.
Metadata Bloat - Photoshop: DocumentAncestors
Un número pequeño pero creciente de usuarios de Photoshop ha notado y se ha quejado
del tamaño excesivo e hinchado de los archivos con ciertos archivos guardados desde
Photoshop. En la mayoría de los casos, esto se debe a los metadatos específicos de
Photoshop conocidos como photoshop: DocumentAncestors que se escriben en el
archivo. file.
¿Cómo sabes si tus archivos tienen metadatos? Una forma es usar el comando "Buscar"
de Adobe Bridge o la característica relacionada "Colecciones inteligentes" se puede usar
para buscar metadatos de archivos para las palabras clave - photoshop:
DocumentAncestors
Photoshop ofrece opciones de Exportar y Exportar / Guardar para la Web que cuentan
con la capacidad de eliminar los metadatos de los archivos guardados. Para muchos
usuarios, estas opciones estándar tienen sentido y funcionan según sea necesario. Sin
embargo, para otros usuarios, los formatos de archivo finales, los modos de color, la
profundidad de bits y otros factores pueden descartar el uso de estas opciones de
exportación basadas en "Internet". Estos usuarios necesitan alternativas.
Adobe no ofrece una opción de preferencia de Photoshop para activar / desactivar estos
metadatos específicos. Por lo tanto, muchos usuarios finales han tenido que encontrar
sus propias soluciones a este problema.
// https://forums.adobe.com/message/8511978#8511978
function deleteDocumentAncestorsMetadata() {
whatApp = String(app.name);//String version of the app name
if(whatApp.search("Photoshop") > 0) { //Check for photoshop
specifically, or this will cause errors
//Function Scrubs Document Ancestors from Files
if(!documents.length) {
alert("There are no open documents. Please open a file to run
this script.")
return;
}
if (ExternalObject.AdobeXMPScript == undefined)
ExternalObject.AdobeXMPScript = new
ExternalObject("lib:AdobeXMPScript");
var xmp = new XMPMeta( activeDocument.xmpMetadata.rawData);
// Begone foul Document Ancestors!
xmp.deleteProperty(XMPConst.NS_PHOTOSHOP,
"DocumentAncestors");
app.activeDocument.xmpMetadata.rawData = xmp.serialize();
}
}
//Now run the function to remove the document ancestors
deleteDocumentAncestorsMetadata();
Este script eliminará los metadatos de photoshop: DocumentAncestors de un archivo
abierto. Se utiliza mejor con Photoshop "Script Events Manager": se activa en eventos
clave como abrir, guardar o exportar un documento. La ejecución del script a través del
Script Events Manager automatiza el proceso de eliminación de estos metadatos
(Archivo> Scripts> Script Events Manager). No tengo conocimiento de un método para
"umbral" la eliminación en un número específico de entradas, todos los photoshop: los
metadatos de DocumentAncestors se eliminarán, ya sea potencialmente útil o excesivo.
Úselo bajo su propio riesgo.
Solución # 2: Adobe Bridge Script (no para usar con imágenes PNG)
// https://forums.adobe.com/thread/2340460
//#target bridge // let EntendScript know what app the script is for
clearDocumentAncestors = {};// create an object
clearDocumentAncestors.execute = function(){// create a method for
that object
var sels = app.document.selections;// store the array of selected
files
for (var i = 0; i < sels.length; i++){//loop though that array
var md = sels[i].synchronousMetadata;// get the metadata for the
file
md.namespace = "http://ns.adobe.com/photoshop/1.0/";// set the
namespace
md.DocumentAncestors = "";
}
app.document.chooseMenuItem("Rotate90CW");
app.document.chooseMenuItem("Rotate90CCW");
};
//refresh cache
// app.document.chooseMenuItem("PurgeCacheForSelected");
// this script only works in bridge
if (BridgeTalk.appName == "bridge"){
//creage the munuItem
var menu = MenuElement.create( "command", "Clear DocumentAncestors
in metadata", "at the end of Tools");
menu.onSelect = clearDocumentAncestors.execute;
};
El script de Adobe Bridge es útil para JPEG u otras imágenes guardadas con
compresión con pérdida, ya que solo se eliminan los metadatos sin que sea necesario
descomprimir / recomprimir los datos de la imagen. Es posible que esta secuencia de
comandos no funcione en Bridge CS6, sin embargo, parece que funciona en varias
versiones de Bridge CC. Úselo bajo su propio riesgo.
Solución # 3: ExifTool
Por supuesto, ExifTool no tiene problemas para manejar este exceso de metadatos en
formatos de imagen comunes como PSD, JPEG, TIFF, etc. Este ejemplo de código de
línea de comando es para Mac OS. Los usuarios del sistema operativo Windows
simplemente cambiarían las comillas simples y rectas a comillas dobles dobles y
utilizarían la ruta completa al directorio o archivo. Úselo bajo su propio riesgo.
Una vez que se ha creado un PDF a partir de imágenes infladas con un exceso de
photoshop: metadatos de DocumentAncestors, los metadatos a nivel de objeto ya no son
accesibles a Adobe Bridge o ExifTool (por lo que las soluciones anteriores no
funcionarán en archivos PDF). Uno tiene que usar un enfoque de fuerza bruta en
Acrobat Pro para eliminar todos los metadatos a nivel de objeto: Herramientas de
producción de impresión> Preflight> Correcciones individuales> Información de
documento y metadatos> Eliminar todos los metadatos XMP a nivel de objeto.
Otra opción es utilizar la opción "Guardar como PDF optimizado", con la opción
"Descartar datos del usuario: descartar información y metadatos del documento"
seleccionada / marcada.
Este script de Photoshop procesará una carpeta de origen que contenga archivos JPEG /
TIFF / PSD y eliminará los metadatos de Photoshop: DocumentAncestors sin abrir las
imágenes en Photoshop. Úselo bajo su propio riesgo.
// https://forums.adobe.com/message/9671488#9671488
#target photoshop;
var inputFolder= Folder.selectDialog ("Please select folder to
process");
if(inputFolder != null){
var fileList = inputFolder.getFiles(/\.(jpg|tif|psd)$/i);
for(var a in fileList){delFileAncestorsMeta(fileList[a]);}
}
function delFileAncestorsMeta(selectedFile) {
if (ExternalObject.AdobeXMPScript == undefined)
ExternalObject.AdobeXMPScript = new
ExternalObject("lib:AdobeXMPScript");
var xmpFile = new XMPFile( selectedFile.fsName, XMPConst.FILE_UNKNOWN,
XMPConst.OPEN_FOR_UPDATE | XMPConst.OPEN_USE_SMART_HANDLER );
var xmp = xmpFile.getXMP();
xmp.deleteProperty(XMPConst.NS_PHOTOSHOP, "DocumentAncestors");
if (xmpFile.canPutXMP(xmp)) {
xmpFile.putXMP(xmp);
xmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
}
};
https://helpx.adobe.com/photoshop/kb/fixed-issues.html
Descarga e instalación de Adobe Scripts
NOTA: Solo pegue el código fuente en editores de texto sin formato como Notepad o
Adobe ExtendScript Toolkit (WordPad o MS Word no son editores de texto sin
formato). Asegúrese de que las comillas rectas simples o dobles "no se conviertan en
curvas".
El código AppleScript debe compilarse usando el ícono indicado (o usando el menú Script> Compilar)
https://developer.apple.com/library/content/documentation/LanguagesUtilities/Conceptu
al/MacAutomationScriptingGuide/CreateaScript.html
https://developer.apple.com/library/content/documentation/AppleScript/Conceptual/App
leScriptX/Concepts/work_with_as.html#//apple_ref/doc/uid/TP40001568-1152365
https://helpx.adobe.com/bridge/using/adobe-bridge-
workspace.html#enable_startup_scripts
NOTA: si se está ejecutando, Adobe Bridge debe cerrarse y reiniciarse para que las
secuencias de comandos recién agregadas sean accesibles.
1. Haga clic con el botón derecho (Windows) o presione Control y haga clic (Mac
OS) en un script en el panel Scripts
2. Elija Revelar en Explorer (Windows) o Revelar en Finder (Mac OS)
https://helpx.adobe.com/indesign/using/scripting.html
NOTA: Si se ejecuta, Adobe InDesign cargará los scripts recién agregados sin tener que
cerrar y reiniciar la aplicación. Los scripts se pueden clasificar y almacenar en
subcarpetas del sistema operativo, que se reflejarán en la interfaz del panel de scripts.
https://helpx.adobe.com/photoshop/using/scripting.html
NOTA: Si se está ejecutando, Adobe Photoshop debe cerrarse y reiniciarse para que las
secuencias de comandos recién agregadas sean accesibles.
NOTA: si se está ejecutando, Adobe Illustrator debe cerrarse y reiniciarse para que las
secuencias de comandos recién agregadas sean accesibles.
FUENTES:
1. http://prepression.blogspot.com/2017/06/metadata-bloat-
photoshopdocumentancestors.html
2. http://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-
scripts.html