• Resolved kimaldis

    (@kimaldis)


    So I’m replacing images in a gallery using PHP & \C_Gallery_Storage::get_instance()->upload_base64_image(). This replaces the actual image but not its cached image files – thumbs, etc. Is there a php method I can use to clear these cache files just for the image I’m replacing?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Imagely

    (@imagely)

    Hi @kimaldis,

    It should be possible to delete the cached files that are associated with the main image, however I apologize as we aren’t able to provide support for this degree of customization.

    We suggest you to check delete_image() method to see how NextGen Gallery handles it because it also contains the code for deleting the associated cached images.

    Thread Starter kimaldis

    (@kimaldis)

    That will work for me. Many thanks.

    Thread Starter kimaldis

    (@kimaldis)

    Following up on this, for the benefit of anyone who might also be looking at this, I could find no code in the delete_image() method that deals with cache management. For galleries and the like I’m using wp_cache_delete() method but wp_cache_delete($pid, ‘ngg_image’) isn’t working in this case.

    So, unless I spot anything more correct I’m using the image object’s meta_data property to find and unlink an image’s cach files and that seems to be working just fine for now.

    In parting, it’s a real shame that Nextgen won’t document their classes here. The plugin works well enough but the supplied galleries aren’t great and the lightroom publish service plugin is missing essential features. Surely 3rd parties adding to the mix could only be a good thing?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Clearing a specific image’s cache files using PHP’ is closed to new replies.