#15 SPi-V never detected

closed-fixed
nobody
None
5
2008-04-09
2008-04-06
Bruno Postle
No

The file detection logic for the command-line tool never detects XML and always interprets it as QTVR:

./freepv-glut ../../testcases/good/spiv/mini.xml

...
state 3: downloading testcases/good/spiv/mini.xml
state 3: file testcases/good/spiv/mini.xml downloaded
FILE type:QTVR
ReadMovieAtom: fread() failed!
state 7: Error during QTVR parsing: No panorama found

I'm not great with C++, but my interpretation of
src/libfreepv/Utils/signatures.cpp is that it will detect JPEG and PNG but then decide that everything else is QTVR.

The plugin doesn't do SPi-V either, though about:plugins lists it ok (I have no trouble with QTVR content):

application/x-director Schockwave dcr Yes

Most SPi-V pages don't work because the server runs a javascript plugin detection that doesn't recognise freepv, but even with pages that don't, freepv decides that the SPi-V content is actually QTVR:

http://wiki.panotools.org/Help:Pano-Tag_SPi-V_Example

"Error during QTVR parsing: No panorama found"

Discussion

  • Leon Moctezuma
    Leon Moctezuma
    2008-04-06

    Logged In: YES
    user_id=1745688
    Originator: NO

    I checked the last modifications to the file signature.cpp in the branch and saw the bug report number 1811163, all the files were being detected just as jpg, png or qtvr, because the 2 old lines of code that were intended to skip the first 4 bytes of code, I modified the function to a similar old state were it was functional for some QTVR and for all SPi-V, and I will consider the bug 1811163 as not solved, could you provide me with the testcase, which was non-functional, I have been looking in several sites and yes the function CheckMagicBytes need to check for the bytes 0x6F6D, 0x766F but after skipping the first 4 bytes of the file.

     
  • Bruno Postle
    Bruno Postle
    2008-04-08

    Logged In: YES
    user_id=35360
    Originator: YES

    Just filling-in more info. The QTVR problem was that a QuickTime file can start with various atoms other than 'moov':

    http://wiki.multimedia.cx/index.php?title=QuickTime_container#Known_Top-Level_Atoms

    In particular, pano2qtvr creates QTVRs that start with an 'ftyp' atom. I'm sure there is a better solution, but this works for me with these particular files:

    Index: src/libfreepv/Utils/signatures.cpp

    --- src/libfreepv/Utils/signatures.cpp (revision 142)
    +++ src/libfreepv/Utils/signatures.cpp (working copy)
    @@ -43,11 +43,14 @@
    //DCR Signature
    char dcr_size=2;
    short dcr_sig[]={0x4658, 0x5249};
    + //ftyp (not moov) Signature
    + char ftyp_size=4;
    + short ftyp_sig[]={0x0000, 0x0000, 0x7466, 0x7079};

    //Signatures to check
    - char sig_types_num=5;
    - short* signature[]={jpg_sig,png_sig,mov_sig,xml_sig,dcr_sig};
    - char sig_sizes[]={jpg_size,png_size,mov_size,xml_size,dcr_size};
    + char sig_types_num=6;
    + short* signature[]={jpg_sig,png_sig,mov_sig,xml_sig,dcr_sig,ftyp_sig};
    + char sig_sizes[]={jpg_size,png_size,mov_size,xml_size,dcr_size,ftyp_size};

    const char* CheckMagicBytes(const char* filename)
    {
    @@ -72,6 +75,7 @@
    //by asigning the first 4 read bytes
    //to the MOV signature
    if(type==2&&i<2) mov_sig[i]=number;
    + if(type==5&&i<2) ftyp_sig[i]=number;

    //The comparation is made by using a bit XOR operator
    //we look for the double implication <->, so the result
    @@ -106,6 +110,8 @@
    return("XML");
    if(type==4)
    return("DCR");
    + if(type==5)
    + return("QTVR");

    //In other case return Unknown
    return("Unknown");

     
  • Bruno Postle
    Bruno Postle
    2008-04-09

    • status: open --> closed-fixed
     
  • RS2YiT <a href="http://rmvhvyffjdes.com/">rmvhvyffjdes</a>, [url=http://dslywnsacxhe.com/]dslywnsacxhe[/url], [link=http://yfyocqoqyafs.com/]yfyocqoqyafs[/link], http://ydxadbjogexb.com/