Jump to:

23355 Posts in 17838 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » CRITICAL: Missing / Disappearing Images

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2 3 4
Go to End
Author Topic: 4281 Views
  • Devlin
    Avatar
    Community Member
    215 Posts

    Re: CRITICAL: Missing / Disappearing Images Link to this post

    Don't use FlushGeneratedImageTask. It will "Remove all cached/generated images created as the result of an image manipulation" and "Actually clear out all the images".

    All resized images inside HTMLEditors will be lost, because the path to the resized image is hardcoded in the image tag.

    e.g.:
    - You have "assets/Uploads/_resampled/ResizedImage200268-02.jpg" somewhere
    - FlushGeneratedImageTask will remove all cached images
    - "assets/Uploads/_resampled/ResizedImage200268-02.jpg" doesnt exists anymore
    - edit "assets/Uploads/_resampled/ResizedImage200268-02.jpg" to "assets/Uploads/02.jpg" and save the DataObject
    - a new "assets/Uploads/_resampled/ResizedImage200268-02.jpg" will be generated.

  • flipsidenz
    Avatar
    Community Member
    49 Posts

    Re: CRITICAL: Missing / Disappearing Images Link to this post

    Hmmm, that's a bit of an oversight....

    Okay, how about this slight change of tack. When I was calling "FlushGeneratedImagesTask", I was only concerned with flushing the resampled folder of a specific directory within "assets/".

    Is there a way to flush all generated images within a certain folder only?

  • Devlin
    Avatar
    Community Member
    215 Posts

    Re: CRITICAL: Missing / Disappearing Images Link to this post

    Sure. Write your own FlushGeneratedImagesTask?

    Anyhow, cached images will be deleted if its original image get deleted. So there is really no good reason to use this task other than to have a clean state for development purposes.

    @see
    Image->onBeforeDelete()
    Image->deleteFormattedImages()

    4281 Views
Page: 1 2 3 4
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.