You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: Add `IMAGE_PROCESS_REMOVE_CLASS` setting, allowing the removal of
`image-process-<transform>` CSS classes after image processing. These
classes are user-assigned to trigger transformations, but once processed,
they may no longer be needed. If enabled, the class is removed, and if it
was the only class, the `class` attribute is deleted entirely.
* refactor: Improve logic for handling class removal and prefixing
- Rename `IMAGE_PROCESS_REMOVE_CLASS` to `IMAGE_PROCESS_ADD_CLASS` (default: `True`)
- Introduce `IMAGE_PROCESS_CLASS_PREFIX` (default: `"image-process-"`) for class name customization
- Update documentation to reflect these changes
* chore: Add tests
* If `IMAGE_PROCESS_ADD_CLASS` is `True`, the `<transform>` name is added
501
+
to the `class` attribute of the image.
502
+
You can customize the class prefix using `IMAGE_PROCESS_CLASS_PREFIX`.
503
+
504
+
* If `IMAGE_PROCESS_ADD_CLASS` is `False`, no class attribute will be added.
505
+
506
+
This setting allows you to control whether transformation details appear
507
+
in the HTML output or to avoid conflicts with custom styles.
508
+
509
+
```python
510
+
# Use a custom class prefix instead of "image-process-"
511
+
IMAGE_PROCESS_CLASS_PREFIX="custom-prefix-"
512
+
513
+
# Disable adding transformation class attributes
514
+
IMAGE_PROCESS_ADD_CLASS=False
515
+
```
516
+
494
517
## Known Issues
495
518
496
519
* Pillow, when resizing animated GIF files, [does not return an animated file](https://github.com/pelican-plugins/image-process/issues/11).
@@ -561,6 +584,5 @@ This project is licensed under the [AGPL-3.0 license](http://www.gnu.org/license
561
584
562
585
[Pelican image](https://web.archive.org/web/20090505115626/http://www.pdphoto.org/PictureDetail.php?mat=&pg=5726) in test data by Jon Sullivan. Published under a [Creative Commons Public Domain license](https://creativecommons.org/licenses/publicdomain/).
0 commit comments