anansi-project / comicinfo

ComicInfo.xml's new home
https://anansi-project.github.io/docs/category/comicinfo
MIT License
141 stars 8 forks source link

Question about ComicPageInfo Type, attribute Image #54

Open t0815 opened 9 months ago

t0815 commented 9 months ago

The Image- Attribute from ComicPageInfo -Type is currently defined as Int- Type.

<xs:complexType name="ComicPageInfo">
        <xs:attribute name="Image" type="xs:int" use="required"/>
        ...
    </xs:complexType>

Is that supposed to be the index within the archive? Or just the page number? Im wondering, because there are no real indices in Zip-Files, only if you just rename all files to the respective index (i.e. 1.jpg).

IMO it would make more sense, to define this as String, to represent the filename within the archive. In the implementation I'm currently using, I do use the Image -attribute to map the Page defined within the Pages -Array to the image filename in the archive.

But I guess for compatibility reasons, that could be a bad idea tho.

Or is KEY supposed to be the filename within the archive? I'm confused.... Altho, theoretically, the page number can just be derived from the item ordering within the index list.

At any rate: I think in the index there should be at some more fields:

ajslater commented 9 months ago

I think Image is supposed to be an index. It would be far clearer if it were called index. I have no idea what Key is supposed to be. But since it's a string you could put filename in there and then BBB.jpg could have Image/index 0 and AAAA.jpg could have Image/index 1 and allow for custom ordering despite the alphanumeric order.

But since the ComicInfo project at Anansi has a major goal of being backwards compatible with ComicRack and other consumers of ComicInfo, I doubt this a changeable feature.

t0815 commented 9 months ago

yea, thanks. I figured as much too, since changing the attributes would break backwards compatibility. I did change my implementation as mentioned. Image -> page number (index), Key -> filename within archive.

C0rn3j commented 1 month ago

Can it please be documented that the Page->Image is an index that relates to the file's alphabetical sorting order?

https://github.com/anansi-project/comicinfo/blob/main/DOCUMENTATION.md#image