zoukankan      html  css  js  c++  java
  • phpexcel一个bug

    大家好!


    我想我发现了这个bug。 如果我从文件中图像删除,它加载正常。 如果有图像时候,何时
    $ objPHPExcel = PHPExcel_IOFactory :: load($ file);
    我得到:.............未定义的偏移:-1 .........在PHPExcel Reader Excel5.php的第911行
    那是 ....
    $ BSE = $ BSECollection [$ BSEindex - 1]; //这里是问题,索引的值将是-1
    $ blipType = $ BSE-> getBlipType();
    从我的讲解中,意味着$ BSEindex的价值为零......
    当然,这将在以后对方法“getBlipType”带来问题,这是在非对象上调用的......

    修复方式:

                                 // picture
                                 // get index to BSE entry (1-based)
                                 $BSEindex = $spContainer->getOPT(0x0104);
    +
    +                            // If there is no BSE Index, we will fail here and other fields are not read.
    +                            // Fix by checking here.
    +                            // TODO: Why is there no BSE Index? Is this a new Office Version? Password protected field?
    +                            // More likely : a uncompatible picture
    +                            if (!$BSEindex) {
    +                                continue;
    +                            }
    +
                                 $BSECollection = $escherWorkbook->getDggContainer()->getBstoreContainer()->getBSECollection();
                                 $BSE = $BSECollection[$BSEindex - 1];
                                 $blipType = $BSE->getBlipType();
      
    

      

  • 相关阅读:
    rstudio命令行操作
    HTTP缓存机制
    F5和Ctrl F5
    g++与gcc区别
    C++中long long和long
    拉链法哈希表实现
    tcp中的带外数据
    LSGAN
    随机森林分类器学习
    python中cls关键字
  • 原文地址:https://www.cnblogs.com/huixuexidezhu/p/9283316.html
Copyright © 2011-2022 走看看