https://github.com/transpect/image-props-extension
XML Calabash extension step for reading image properties such as width
https://github.com/transpect/image-props-extension
image-analysis images
Last synced: 8 months ago
JSON representation
XML Calabash extension step for reading image properties such as width
- Host: GitHub
- URL: https://github.com/transpect/image-props-extension
- Owner: transpect
- License: bsd-2-clause
- Created: 2015-04-27T07:47:10.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2024-01-09T15:58:20.000Z (over 2 years ago)
- Last Synced: 2025-01-13T01:14:03.155Z (over 1 year ago)
- Topics: image-analysis, images
- Language: Java
- Size: 5.09 MB
- Stars: 0
- Watchers: 17
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# image-props-extension
XML Calabash extension step for reading image properties such as width
An XML Calabash extension for extracting image information
from PNG, JPEG, SVG etc. Whereas SVG is currently unsupported
due to an incompatibility between Batik and validator.nu’s
htmlparser.
Written by Oliver Swoboda, le-tex publishing services GmbH
(small portions also by Gerrit Imsieke)
It requires several Apache libraries that are bundled with this repo.
xmlgraphics-commons-1.5.jar
commons-imaging-1.0-SNAPSHOT.jar
For SVG analysis, it needs
* batik-1.7/*
* fop.jar
See http://www.apache.org/licenses/LICENSE-2.0.txt for the libraries'
licenses.
Usage example (from the checked-out directory):
calabash/calabash.sh extensions/transpect/ltx-image-identify/ltx-example.xpl
It requires
[calabash-distro](https://github.com/transpect/calabash-distro) and
[calabash-frontend](https://github.com/transpect/calabash-frontend) to
be installed (for example, by installing calabash-frontend with
recursive submodule checkout).
Step signature:
```xml
```
tr:image-identify passes documents from its source to its result
port (this is because the step is better chainable this way). As a
side effect, it will create a c:results document with image properties
on the report port. The result (er, report) of the sample invocation
above looks like this:
```xml
```
You can also print additional image metadata like Exif when you set the option
`metadata` to `yes`.
```xml
```
## Compilation (Unix paths):
```
javac -target 1.8 \
-cp ../../../distro/xmlcalabash-1.3.2-100.jar:lib/xmlgraphics-commons-1.5.jar:lib/commons-imaging-1.0-alpha2.jar:lib/metadata-extractor-2.18.0.jar:lib/xmpcore-6.0.6.jar \
src/main/java/io/transpect/calabash/extensions/ImageIdentify.java
```
### On Cygwin:
```
/cygdrive/c/Program\ Files\ \(x86\)/Java/jdk1.7.0_40/bin/javac \
-cp $(cygpath -map ../../../calabash.jar:xmlgraphics-commons-1.5.jar:commons-imaging-1.0-SNAPSHOT.jar) \
ImageIdentify.java
```