Skip to content

Null exception on checking data URL - EpubCheck 5.0.1 and 5.1.0 #1536

Closed

Description

@rachanak-dk

Hi,

When I check a fixed layout epub using the EpubCheck 5.0.1 or EpubCheck 5.1.0, I get the following. No errors on EpubCheck 5.0.0 and earlier versions. OPF file is also validated and has no resource path issues:

java.lang.NullPointerException: null input
at io.mola.galimatias.URLParser.parse(URLParser.java:215)
at io.mola.galimatias.URL.withPath(URL.java:397)
at io.mola.galimatias.canonicalize.DecodeUnreservedCanonicalizer.canonicalize(DecodeUnreservedCanonicalizer.java:41)
at org.w3c.epubcheck.util.url.URLUtils.normalize(URLUtils.java:188)
at com.adobe.epubcheck.ocf.OCFContainer.contains(OCFContainer.java:88)
at com.adobe.epubcheck.ocf.OCFContainer.isRemote(OCFContainer.java:134)
at org.w3c.epubcheck.core.references.ResourceReferencesChecker.checkReference(ResourceReferencesChecker.java:120)
at org.w3c.epubcheck.core.references.ResourceReferencesChecker.check(ResourceReferencesChecker.java:102)
at com.adobe.epubcheck.opf.OPFChecker.checkPackage(OPFChecker.java:149)
at com.adobe.epubcheck.opf.OPFChecker30.checkPackage(OPFChecker30.java:67)
at com.adobe.epubcheck.opf.OPFChecker.check(OPFChecker.java:94)
at com.adobe.epubcheck.ocf.OCFChecker.check(OCFChecker.java:173)
at com.adobe.epubcheck.api.EpubCheck.doValidate(EpubCheck.java:218)
at com.adobe.epubcheck.tool.EpubChecker.validateFile(EpubChecker.java:250)
at com.adobe.epubcheck.tool.EpubChecker.processFile(EpubChecker.java:325)
at com.adobe.epubcheck.tool.EpubChecker.run(EpubChecker.java:150)
at com.adobe.epubcheck.tool.Checker.main(Checker.java:31)

Activity

  1. prithiviclteam commented on Aug 2, 2023

    @prithiviclteam
  2. titusz commented on Aug 4, 2023

    @titusz

    I can confirm the issue. I also get:

    java.lang.NullPointerException: null input
            at io.mola.galimatias.URLParser.parse(URLParser.java:215)
            at io.mola.galimatias.URL.withPath(URL.java:397)
            at io.mola.galimatias.canonicalize.DecodeUnreservedCanonicalizer.canonicalize(DecodeUnreservedCanonicalizer.java:41)
            at org.w3c.epubcheck.util.url.URLUtils.normalize(URLUtils.java:188)
            at com.adobe.epubcheck.ocf.OCFContainer.contains(OCFContainer.java:88)
            at com.adobe.epubcheck.ocf.OCFContainer.isRemote(OCFContainer.java:134)
            at org.w3c.epubcheck.core.references.ResourceReferencesChecker.checkReference(ResourceReferencesChecker.java:120)
            at org.w3c.epubcheck.core.references.ResourceReferencesChecker.check(ResourceReferencesChecker.java:102)
            at com.adobe.epubcheck.opf.OPFChecker.checkPackage(OPFChecker.java:149)
            at com.adobe.epubcheck.opf.OPFChecker30.checkPackage(OPFChecker30.java:67)
            at com.adobe.epubcheck.opf.OPFChecker.check(OPFChecker.java:94)
            at com.adobe.epubcheck.ocf.OCFChecker.check(OCFChecker.java:173)
            at com.adobe.epubcheck.api.EpubCheck.doValidate(EpubCheck.java:218)
            at com.adobe.epubcheck.tool.EpubChecker.validateFile(EpubChecker.java:250)
            at com.adobe.epubcheck.tool.EpubChecker.processFile(EpubChecker.java:325)
            at com.adobe.epubcheck.tool.EpubChecker.run(EpubChecker.java:150)
            at com.adobe.epubcheck.tool.Checker.main(Checker.java:31)
    

    Repoduce with attached sample EPUB:
    nullpointer_epub.zip

  3. mattgarrish commented on Aug 4, 2023

    @mattgarrish
    Member

    Repoduce with attached sample EPUB:

    Looks like the data url in the background-image declaration in the Style.css file is causing it.

  4. rachanak-dk commented on Aug 7, 2023

    @rachanak-dk
    Author

    Repoduce with attached sample EPUB:

    Looks like the data url in the background-image declaration in the Style.css file is causing it.

    @mattgarrish: Thank you for your response. We are checking the URL pointed out by you which indeed is the one causing the issue.
    Thanks

  5. mattgarrish commented on Aug 7, 2023

    @mattgarrish
    Member

    Reopening this until @rdeltour has a chance to look into it. It seems to be symptomatic of a bigger issue with them, as you shouldn't get a null exception error. Even if I put the data URL into an img tag, or remove the fxl metadata, I get the exception.

    Off the top of my head, the only requirement on their use is that they define a core media type, which appears to be the case here.

  6. changed the title [-]Null exception on checking fixed layout epubs - EpubCheck 5.0.1 and 5.1.0[/-] [+]Null exception on checking data URL - EpubCheck 5.0.1 and 5.1.0[/+] on Aug 7, 2023
  7. b-t-k commented on Aug 14, 2023

    @b-t-k

    As far as I can tell this affects 100% of our fxl files which now has Overdrive bouncing them. I am trying to figure out why the original producers bothered to add the background as it seems to be 1 pixel dot;

    .trn_link {
    	background-image:url('data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICR??AEAOw==');
    	position:absolute;
    }
    
  8. titusz commented on Aug 15, 2023

    @titusz

    1 pixel images are often used for clickable links that do not wrap any text. It seems that the Data URL is problematic. If you replace it with data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 it works fine.

  9. SimonPRH commented on Aug 17, 2023

    @SimonPRH

    Can confirm all our FXL getting same null pointer exception.

    Failure case:
    data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICR??AEAOw==

    When replaced with the URL Titusz gave above, no issues.

    File is ANCIENT and produced by some old supplier. Offhand I don't actually know what that string after base64 actually means/does!

  10. mattgarrish commented on Aug 17, 2023

    @mattgarrish
    Member

    Ya, I think I see what's going on. Per the data URL syntax, characters outside the safe range of URL characters have to be escaped. If you percent encode the question marks in the original then you no longer get a null exception from epubcheck.

    Of course, epubcheck should report the URL as invalid, not throw a null exception error, so that still needs fixing.

    (It also doesn't look like the original data URL is properly base64 encoded, as even after fixing the problem I still get an invalid image.)

  11. rdeltour commented on Aug 31, 2023

    @rdeltour
    Member

    +1 on @mattgarrish's analysis: the URL looks non-conforming so should be reported, but EPUBCheck should definitely not throw a NullPointerException in that case. I'll look into it for the next milestone. Thanks all for the report!

  12. self-assigned this
    on Aug 31, 2023
  13. vengattech commented on Sep 27, 2023

    @vengattech

    The latest ePUBChecker 5.1.0 ignores the Thumbs.db error. The availability of Thumbs.db inside the image folder needs to be checked manually before hosting or delivering the ePUB files to clients.

  14. vengattech commented on Sep 27, 2023

    @vengattech

    The below issues is also in the earlier version 5.0.1.

    The latest ePUBChecker 5.1.0 ignores the Thumbs.db error. The availability of Thumbs.db inside the image folder needs to be checked manually before hosting or delivering the ePUB files to clients.

  15. added
    status: in progressThe issue is being implemented by the development team
    and removed on Dec 21, 2024
  16. added a commit that references this issue on Dec 23, 2024
    c50536d
  17. added
    status: has PRThe issue is being processed in a pull request
    and removed
    status: in progressThe issue is being implemented by the development team
    on Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

status: has PRThe issue is being processed in a pull requesttype: bugThe issue describes a bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    ⌂ 换网址