Skip to content

Best way to remove old styles #164

Open

Description

@flyingL123

What is the best way to remove old styles from s3 for an attachment? Is there a build in way to do this? For example, in s3, an attachment currently has thumbnail, standard, original, and zoom. However, on the model, I have removed the standard style. When I run the reprocess command on the attachment, I was hoping the standard style would be deleted from s3, but that doesn't seem to be happening.

Is there a way to do this using the library or do I have to manually remove the old files?

Activity

  1. tabennett commented on Aug 9, 2016

    @tabennett
    Contributor

    The reprocess command doesn't remove old styles because it has no way of knowing what was (previously) there. If you wanna build a command specifically for removing an old style I'll help you get it cleaned up and merged in, but it needs to be for the laravel-stapler repo. I'm working on a 2.0 release that I could add this to if it doesn't get done now. I've gotta ask though; If you just have a single style that you want to remove, why not just remove those images (in the standard folder) using the AWS console?

  2. flyingL123 commented on Aug 9, 2016

    @flyingL123
    Author

    Ok, I will try to find some time to build that command. I think your question is assuming that all of the standard style images are in a single folder. That's not how the files are organized. They are first partitioned by id, then the different style directories are within that. In other words:

    001 > original
          standard
          thumbnail
          zoom
    002 > original
          standard
          thumbnail
          zoom
    003 > original
          standard
          thumbnail
          zoom
    

    There are hundreds of images, so I would need to go into every id folder and delete the standard directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions