Difference in [image-metedata] processing

52 views
Skip to first unread message

Toshihiko Makita

unread,
Sep 7, 2017, 10:32:23 AM9/7/17
to DITA-OT Users
Hi list,

I'm developing my own DITA to WordprocessingML DITA-OT plug-in by referencing Jarno's com.elovirta.ooxml plug-in.
Now I have reached image processing and noticed that I need the image size that can be obtained using DITA-OT org.dita.dost.module.ImageMetadataModule class. So I inserted following target in build.xml.

 <target name="ah.wml.image-metadata" description="Read image metadata">
 
<pipeline message="Read image metadata." taskname="image-metadata" tempdir="${dita.temp.dir}">
 
<module class="org.dita.dost.module.ImageMetadataModule">
 
<param name="outputdir" location="${output.dir}"/>
 
</module>
 
</pipeline>
 
</target>

Here is excerpt of my DITA-OT log file. DITA-OT fails to get image size from the bird.tif file.

preprocess:
ah.wml.image-metadata:
[image-metadata] Processing D:\SVN\pdf5\testdata-ooxml\20170907-image\temp\wml\cImageTest.dita
[image-metadata] Reading file:/D:/SVN/pdf5/testdata-ooxml/20170907-image/image/bird.tif
[image-metadata] Image file:/D:/SVN/pdf5/testdata-ooxml/20170907-image/image/bird.tif format not supported
[image-metadata] Reading file:/D:/SVN/pdf5/testdata-ooxml/20170907-image/image/flower.gif
[image-metadata] Reading file:/D:/SVN/pdf5/testdata-ooxml/20170907-image/image/tys125f.jpg

However com.elovirta.ooxml plug-in succeeded this step:

preprocess:
docx.image-metadata:
[image-metadata] Processing D:\SVN\pdf5\testdata-ooxml\20170907-image\temp\docx\cImageTest.dita
[image-metadata] Reading file:/D:/SVN/pdf5/testdata-ooxml/20170907-image/image/bird.tif
[image-metadata] Reading file:/D:/SVN/pdf5/testdata-ooxml/20170907-image/image/flower.gif
[image-metadata] Reading file:/D:/SVN/pdf5/testdata-ooxml/20170907-image/image/tys125f.jpg

The result of both plug-ins are as follows:

My plug-in:

<image href="image/bird.tif" id="image_v11_stg_dbb" placement="inline" class="- topic/image " xtrf="file:/D:/SVN/pdf5/testdata-ooxml/20170907-image/cImageTest.dita" xtrc="image:1;10:60"/>

com.elovirta.ooxml plug-in

<image href="image/bird.tif" id="image_v11_stg_dbb" placement="inline" class="- topic/image " xtrf="file:/D:/SVN/pdf5/testdata-ooxml/20170907-image/cImageTest.dita" xtrc="image:1;10:60" dita-ot:image-width="80" dita-ot:image-height="100" dita-ot:horizontal-dpi="72" dita-ot:vertical-dpi="72"/>

Could you tell my what is wrong with my plug-in to get the image size?

Regards,

-- 
/*--------------------------------------------------
 Toshihiko Makita
 Development Group. Antenna House, Inc. Ina Branch
 Web site:
 http://www.antenna.co.jp/
 http://www.antennahouse.com/
 --------------------------------------------------*/ 
bird.tif

Radu Coravu

unread,
Sep 8, 2017, 1:39:37 AM9/8/17
to Toshihiko Makita, DITA-OT Users
Hi Toshihiko,

I suspect that when this did not work you were using the command line and when it worked you were using Oxygen XML Editor to start the DITA OT.
The default Java libraries have no default support for reading TIFF images.
So with a DITA OT run from the console with no matter what transtype the image reader will not be able to read the tiff image dimensions.
In the Oxygen XML Editor installation folder there is a "lib" folder which contains a "jai_tiff.jar". If the DITA OT ANT process is started with a reference to this JAR library in the classpath, the library adds support for working with TIFF images in the Java VM.
So if you run the DITA OT from inside Oxygen reading the TIFF image dimensions will work because we add this JAR in the classpath used to start the DITA OT.

The "jai_tiff.jar" library is free to use, it has a license key next to it, I compiled it some time ago from an older Java Sun project.

Regards,
Radu

--
You received this message because you are subscribed to the Google Groups "DITA-OT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Toshihiko Makita

unread,
Sep 8, 2017, 3:15:05 AM9/8/17
to DITA-OT Users
Hi Radu,

Thank you for you advice!

I suspect that when this did not work you were using the command line and when it worked you were using Oxygen XML Editor to start the DITA OT.

Yes, you are absolutely right.  I appreciate your sharp insight.
Reply all
Reply to author
Forward
0 new messages