New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with determining format="image" for keydefs in the .job.xml #2653

Closed
raducoravu opened this Issue Apr 10, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@raducoravu
Member

raducoravu commented Apr 10, 2017

Let's say that in the topic I have a keyref to an image:

 <image keyref="welcome" scalefit="yes"/>

and in the DITA Map I have this:

 <keydef keys="welcome" href="i_welcome.png" format="png"/>

and I publish to XHTML for example. Looking in the .job.xml I see this:

    <file src="file:/C:/Users/radu_coravu/Desktop/ann/test_user_guide/i_welcome.png"
        uri="i_welcome.png" path="i_welcome.png"
        result="file:/C:/Users/radu_coravu/Desktop/ann/test_user_guide/i_welcome.png"
        format="html" resource-only="true"/>

So the file appears with format="html" meaning from what I understand that copy operations with file sets like this:

        <dita-fileset format="image"/>

will not match it.
It seems that one of the jobs of ImageMetadataModule is to set the proper format for the image resource. But the ImageMetadataModule seems to be called way after the .job.xml is serialized so this does not seem to help at all....

@robander

This comment has been minimized.

Show comment
Hide comment
@robander

robander May 9, 2017

Member

I found that keys for images (and other images referenced from the map) only worked if format="image" was used, rather than something like gif or png. I didn't think much of it at the time and considered that to be the design... but originally I thought format="jpg" would work.

Member

robander commented May 9, 2017

I found that keys for images (and other images referenced from the map) only worked if format="image" was used, rather than something like gif or png. I didn't think much of it at the time and considered that to be the design... but originally I thought format="jpg" would work.

@jelovirt

This comment has been minimized.

Show comment
Hide comment
@jelovirt

jelovirt May 16, 2017

Member

Originally the @format in job configuration corresponded with whatever was set on the DITA topics or maps. Over time this is no longer that case and the @format should be seen as something that's internal to job configuration. The value html is something that's used to categorize non-DITA content, and later on in image metadata module we categorize images as image. It would be convenient to use image from the start of the preprocess, but e.g. for keys we don't know what the target format is until we actually resolve the keys.

Maybe the @format attribute in job configuration should be renamed to something else to make the difference explicit.

Member

jelovirt commented May 16, 2017

Originally the @format in job configuration corresponded with whatever was set on the DITA topics or maps. Over time this is no longer that case and the @format should be seen as something that's internal to job configuration. The value html is something that's used to categorize non-DITA content, and later on in image metadata module we categorize images as image. It would be convenient to use image from the start of the preprocess, but e.g. for keys we don't know what the target format is until we actually resolve the keys.

Maybe the @format attribute in job configuration should be renamed to something else to make the difference explicit.

@jelovirt

This comment has been minimized.

Show comment
Hide comment
@jelovirt

jelovirt May 16, 2017

Member

Fixed in ba868f7

Member

jelovirt commented May 16, 2017

Fixed in ba868f7

@jelovirt jelovirt closed this May 16, 2017

@jelovirt jelovirt added this to the 2.5 milestone May 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment