| #
dd9e8e5e |
| 23-Apr-2026 |
Andreas Gohr <andi@splitbrain.org> |
fix EXIF-rotated images shown cropped in previews, closes #4482
JPEGs with EXIF orientation 5/6/7/8 were rendered cropped in the mediamanager detail view, the image diff view and the fullscreen deta
fix EXIF-rotated images shown cropped in previews, closes #4482
JPEGs with EXIF orientation 5/6/7/8 were rendered cropped in the mediamanager detail view, the image diff view and the fullscreen detail page: getimagesize() / JpegMeta report raw (rotation-unaware) pixel dimensions, and passing both w and h to fetch.php defaults to center-crop.
- Bump splitbrain/slika to 1.1, which ships ImageInfo: a rotation- aware, metadata-only dimension simulator mirroring Adapter's fluent API (autorotate/resize/crop). - Add fit=1 to fetch.php: when both w and h are given, route to media_resize_image() (bbox fit) instead of media_crop_image(). Token hashes only (id, w, h) so existing tokens stay valid. - Add MediaFile::getDisplayDimensions($w, $h, $crop) which delegates to ImageInfo and returns the dims fetch.php would produce. - Add Display::getDetailHtml() and retire media_preview() / the old media_image_preview_size() helper. media_tab_view and MediaDiff now share the Display-based renderer. - Rewrite tpl_img() (lib/tpl/*/detail.php) to use MediaFile dims + fit=1 URL; drops the manual ratio math. - Tests: MediaFileTest covers the dims math, DisplayTest covers the detail-view HTML (rotated dims, rev-vs-timestamp URL selection, structure), fetch_imagetoken gains a fit-token compat test. Fixture _test/data/media/wiki/exif-orient-6.jpg: 20x30 JPEG with EXIF orientation 6.
show more ...
|
| #
6c16a3a9 |
| 14-Sep-2023 |
fiwswe <fiwswe@fwml.de> |
Use str_starts_with/str_ends_with
|
| #
e2d055f5 |
| 29-Aug-2023 |
Andreas Gohr <andi@splitbrain.org> |
Apply rector fixes to inc/Ui
|
| #
8e9d8d55 |
| 24-Jun-2022 |
Andreas Gohr <andi@splitbrain.org> |
minor SVG improvements
* never try to use slika to resize SVGs - let the browser do it * use object-fit:cover for all images - this properly crops inside the browser if the backend didn't (like fo
minor SVG improvements
* never try to use slika to resize SVGs - let the browser do it * use object-fit:cover for all images - this properly crops inside the browser if the backend didn't (like for SVGs). currently dokuwiki template only - might be worth moving to default styles * show previews for SVGs in media manager
show more ...
|
| #
0603f506 |
| 13-Jan-2021 |
Andreas Gohr <andi@splitbrain.org> |
rename namespace Media to File
This is a bit more generic and allows us to have additional File abstractions in here later.
|
| #
9453716d |
| 06-Jan-2021 |
Andreas Gohr <andi@splitbrain.org> |
readded $jump mechanism, removed unused functions
|
| #
9a1a86fb |
| 06-Jan-2021 |
Andreas Gohr <andi@splitbrain.org> |
fix entity definition
|
| #
79b00823 |
| 06-Jan-2021 |
Andreas Gohr <andi@splitbrain.org> |
reenable the option to display a relative namespace for media files
This is used when searching for media files
|
| #
4f33babf |
| 05-Jan-2021 |
Andreas Gohr <andi@splitbrain.org> |
make use of the new media file classes
This just crudely replaces the calls to the old functions with usage of the new classes. This however already works and makes (manual) testing of these classes
make use of the new media file classes
This just crudely replaces the calls to the old functions with usage of the new classes. This however already works and makes (manual) testing of these classes easier.
Next steps: remove the old media_printfile and media_printfile_thumbs methods and fix/drop/replace the tests depending on them. search_media might be obsolete, too already.
For search results the display classes need to show full namespaces. This needs to be fixed again. No idea about the jump mechanism, yet.
show more ...
|
| #
bf9684bc |
| 05-Jan-2021 |
Andreas Gohr <andi@splitbrain.org> |
first go a refactoring the media manager
For now this only adds code. This takes care of encapsulating media file information and has some UI classes to display those files in the fullscreen media m
first go a refactoring the media manager
For now this only adds code. This takes care of encapsulating media file information and has some UI classes to display those files in the fullscreen media manager and the popup.
The code is untested and not integrated to run, yet. Next step is to replace the parts in the media manager to call this new code (and fix any bugs).
I tried not to change much HTML yet. This can be done later. For now the goal is to just make it run again.
show more ...
|