photopea / UTIF.js

Fast and advanced TIFF decoder
MIT License
424 stars 87 forks source link

UDOC:Uncaught ReferenceError: UDOC is not defined #116

Closed tsoil closed 1 year ago

photopea commented 1 year ago

what should I do to see this bug happen? Could you share your image?

tsoil commented 1 year ago

what should I do to see this bug happen? Could you share your image? intp==5

tsoil commented 1 year ago

what should I do to see this bug happen? Could you share your image?

UDOC is not defined and whether additional dependencies need to be introduced

photopea commented 1 year ago

Does it happen when you parse a specific image with UTIF.js? Could you share that image?

johnthad commented 1 year ago

I have an image hitting this same promise rejection, but I don't believe I can share it. I can say that is seems to have a large block of Photoshop XML included:

$ tiffinfo /Users/thad/corpdev/test_images/Ch_Logo.TIF > ~/Ch_Logo.info
TIFFReadDirectory: Warning, Unknown field with tag 37680 (0x9330) encountered.
TIFFFetchDirectory: Sanity check on directory count failed, this is probably not a valid IFD offset.
TIFFReadCustomDirectory: Failed to read custom directory at offset 494196.

Results:

  === TIFF directory 0 ===
  TIFF Directory at offset 0x78972 (493938)
    Subfile Type: (0 = 0x0)
    Image Width: 591 Image Length: 177
    Resolution: 300, 300 pixels/inch
    Bits/Sample: 8
    Compression Scheme: None
    Photometric Interpretation: separated
    Orientation: row 0 top, col 0 lhs
    Samples/Pixel: 4
    Rows/Strip: 177
    Planar Configuration: single image plane
    Software: Adobe Photoshop CS4 Windows
    DateTime: 2010:07:21 10:18:41
    XMLPacket (XMP Metadata):
  <?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
  <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 4.2.2-c063 53.352624, 2008/07/30-18:12:18        ">
     <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
        <rdf:Description rdf:about=""
              xmlns:dc="http://purl.org/dc/elements/1.1/">
           <dc:format>image/tiff</dc:format>
...
photopea commented 1 year ago

ok, it should be fixed now, update your UTIF.js from here.

photopea commented 1 year ago

@johnthad BTW. your "Photoshop XML" is actually XMP metadata - https://en.wikipedia.org/wiki/Extensible_Metadata_Platform

It is an open standard, a replacement for EXIF metadata.