3D FlipBook - Thumbnail not renewed when PDF changes

m***t@mindspring.com
2021-07-03
2021-07-12

My users need to see my PDF displayed in 3D Flipbook format before they can recommend changes. So I end up switching out PDFs for the same Flipbook fairly often. I love being able to do this so easily - once I've changed the PDF in the Media Library, I just go in the 3D Flipbook and reset the PDF setting. My only problem is that I'm using auto-thumbnails, and I often find that the thumbnail for that Flipbook has not changed. I found the auto-thumbnails file in ...wp-content/uploads/3dflipbook/auto-thumbnails, and found that deleting the thumbnail for that flipbook solved the problem; the correct thumbnail was then created.

Would you be able to change your code, so that changing the entry for PDF in the back-end for a 3D Flipbook would delete that thumbnail? That would make my life easier!

Thanks so much for this wonderful tool!

Replies

a***r@3dflipbook.net
2021-07-09
2021-07-09

Just checked on our debug server: replace pdf file-> update the book-> refresh a page with thumbnail - works fine. Maybe browser cache problem? the code for this is:

  function post_auto_thumbnail_save($id, $b64) {
    $dir = get_auto_thumbnail_dir();
    $fn = $dir.'/'.$id.'.png';
    if($b64!=='') {
      if(!file_exists($dir)) {
        mkdir($dir, 0777, TRUE);
      }
      file_put_contents($fn, base64_decode($b64));
    }
    else if(file_exists($fn)){
      unlink($fn);
    }
  }

it always overwrites.

k***s@stepmommagazine.com
2021-10-31
2021-10-31

I just ran into this issue too. The problem is that the above $id is based on the post/page ID, which does not change. So every time the PDF is changed, the thumbnail file does not change. For example, it stays as 120000.png. I just had to put special case rules for expiration in the apache config, but ideally the plugin should use a random filename when generating the thumbnail. Since the same filename is used, browsers may not see that the file changed and will use the cache expiration of the old thumbnail.

Log In to leave a comment