Giter Club home page Giter Club logo

Comments (11)

danielweck avatar danielweck commented on September 2, 2024

Maps to EPUB rendition:spread-portrait

from webpub-manifest.

HadrienGardeur avatar HadrienGardeur commented on September 2, 2024

From the EPUB spec:

Reading Systems SHOULD treat the value “portrait” as a synonym of “both” and create spreads regardless of orientation.

We don't define portrait either in the EPUB extension.

from webpub-manifest.

danielweck avatar danielweck commented on September 2, 2024

The fact that they are synonyms does not mean that we should remove one of them, right?

Plus, this is a breaking change:

TypeScript:

https://github.com/readium/r2-shared-js/blob/41eb2bf265d0145ef17a6affd159f2e79ea6d7ed/src/parser/epub.ts#L1390-L1393

               case "rendition:spread": {
                    rendition.Spread = meta.Data;
                    break;
}

https://github.com/readium/r2-shared-js/blob/41eb2bf265d0145ef17a6affd159f2e79ea6d7ed/src/parser/epub.ts#L1277-L1280

            case "rendition:spread-portrait": {
                propertiesStruct.Spread = "portrait";
                break;
}

Go:

https://github.com/readium/r2-streamer-go/blob/e4bf2ff6f829c2e6a87d62d83e4edf7bb876859c/parser/epub.go#L417-L418

case "rendition:spread":
rendition.Spread = meta.Data

https://github.com/readium/r2-streamer-go/blob/e4bf2ff6f829c2e6a87d62d83e4edf7bb876859c/parser/epub.go#L374-L375

case "rendition:spread-portrait":
propertiesStruct.Spread = "portrait"

Swift:

https://github.com/readium/r2-streamer-swift/blob/de36714b6137ff73c7f2b46700363771322fbfba/Sources/parser/OPFParser.swift#L318-L319

case "rendition:spread-portrait":
properties.spread = "portrait"

https://github.com/readium/r2-streamer-swift/blob/de36714b6137ff73c7f2b46700363771322fbfba/Sources/parser/MetadataParser.swift#L53-L57

        if let renditionSpread = metas.first(where: { $0.attributes["property"] == "rendition:spread" }) {
            let spread = renditionSpread.string

            metadata.rendition.spread = RenditionSpread(rawValue: spread)
}

Kotlin:

https://github.com/readium/r2-streamer-kotlin/blob/097db8477680b434360283efc032e509c6a485af/r2-streamer/src/main/java/org/readium/r2/streamer/parser/epub/MetadataParser.kt#L37-L39

        metas.firstOrNull { it.attributes["property"] == "rendition:spread" }?.text?.let {
            metadata.rendition.spread = RenditionSpread.fromString(it)
}

https://github.com/readium/r2-streamer-kotlin/blob/097db8477680b434360283efc032e509c6a485af/r2-streamer/src/main/java/org/readium/r2/streamer/parser/epub/OPFParser.kt#L142-L149

            when (property) {
                "rendition:spread-node" -> "none"
                "rendition:spread-auto" -> "auto"
                "rendition:spread-landscape" -> "landscape"
                "rendition:spread-portrait" -> "portrait"
                "rendition:spread-both" -> "both"
                else -> null
}?.let { properties.spread = it }

from webpub-manifest.

HadrienGardeur avatar HadrienGardeur commented on September 2, 2024

portrait is deprecated, we usually don't include deprecated properties or metadata.

from webpub-manifest.

HadrienGardeur avatar HadrienGardeur commented on September 2, 2024

I've looked at the commit history and even all the way back to our initial commit in early 2017, portrait wasn't included: 4e8bb7c#diff-d2af120839dd0010c08c91e6da2eb346R17

from webpub-manifest.

danielweck avatar danielweck commented on September 2, 2024

For tracking purposes:
http://www.idpf.org/epub/31/spec/epub-packages.html#fxl-property-spread-portrait

Use of the portrait value with the rendition:spread property is deprecated. The rendition:spread-portrait spine override is similarly deprecated.

from webpub-manifest.

danielweck avatar danielweck commented on September 2, 2024

Conclusion: the JSON Schema is correct, all the Readium2 implementations must be updated, right?

from webpub-manifest.

danielweck avatar danielweck commented on September 2, 2024

EPUB 3.2 is more relevant than my above 3.1 link:
https://w3c.github.io/publ-epub-revision/epub32/spec/epub-packages.html#spread-values

The use of spreads only in portrait orientation is deprecated. Authors are advised to use the value "both" instead, as spreads that are readable in portrait orientation are also readable in landscape. Reading Systems SHOULD treat the value "portrait" as a synonym of "both" and create spreads regardless of orientation.

from webpub-manifest.

HadrienGardeur avatar HadrienGardeur commented on September 2, 2024

Conclusion: the JSON Schema is correct, all the Readium2 implementations must be updated, right?

That would be my conclusion as well.

from webpub-manifest.

danielweck avatar danielweck commented on September 2, 2024

I fixed the TypeScript implementation:
readium/r2-shared-js@1cbe0a5

I'll file issues for Kotlin Go and Swift.

from webpub-manifest.

danielweck avatar danielweck commented on September 2, 2024

Done:
readium/go-toolkit#43
readium/r2-streamer-swift#80
readium/r2-streamer-kotlin#58

from webpub-manifest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.