Skip to content

Commit 45a3336

Browse files
PavelWeirichpaveljanda
authored andcommitted
Update the docs section Deleting image
1 parent a793f52 commit 45a3336

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.docs/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,21 @@ $img_object = $imageStorage->fromIdentifier('images/ed/kitty.jpg');
127127
$this->imageStorage->delete($img_object);
128128
```
129129

130+
If you only want to delete changed images, set the second parameter to TRUE:
131+
```php
132+
<?php declare(strict_types = 1);
133+
134+
// from string
135+
$img = 'images/ed/kitty.jpg';
136+
$this->imageStorage->delete($img, true);
137+
138+
// OR from object
139+
$img_object = $imageStorage->fromIdentifier('images/ed/kitty.jpg');
140+
$this->imageStorage->delete($img_object, true);
141+
```
142+
The original images remain saved.
143+
144+
130145
## Friendly URL
131146

132147
The transformed image name does not look to much friendly (eg `/avatars/kitty.200x200.fit.jpg`).

0 commit comments

Comments
 (0)