fix(media): don't upscale small images in the detail previewsThe detail page, media manager and media diff requested a bounding-boxresize at the full box size, so an image smaller than the box was
fix(media): don't upscale small images in the detail previewsThe detail page, media manager and media diff requested a bounding-boxresize at the full box size, so an image smaller than the box was enlargedand fetch.php generated and cached the upscaled copy.slika 1.2 adds an $upscale option to resize/crop. getDisplayDimensions()now takes a $fit flag mirroring fetch.php one to one and predicts thematching no-upscale dimensions, media_resize_image()/media_mod_image()forward $upscale, and fetch.php disables upscaling for fit=1 requests.In-page image scaling is unchanged.
show more ...
Fix diff view comparing a deleted page with itself (#4635)When opening the diff of a deleted page without explicit rev parameters(?do=diff), Diff::handle() resolved the older side via getRevisions
Fix diff view comparing a deleted page with itself (#4635)When opening the diff of a deleted page without explicit rev parameters(?do=diff), Diff::handle() resolved the older side via getRevisions(0, 1).That helper only skips the current revision when the item file stillexists, so for a deleted page it returned the deletion entry itself andthe view ended up comparing the current revision with itself ("no way tocompare when less than two revisions", empty diff).Use getRelativeRevision($rev2, -1) instead, which returns the revisionimmediately before the current one regardless of whether the page fileis still present. This covers both pages deleted through DokuWiki andexternally deleted pages (whose synthesized deletion entry is nowpersisted to the changelog).Add PageDiffTest and PageChangeLogTest covering the resolved revisionpair and the underlying changelog walk-back for both deletion kinds.
fix EXIF-rotated images shown cropped in previews, closes #4482JPEGs with EXIF orientation 5/6/7/8 were rendered cropped in themediamanager detail view, the image diff view and the fullscreendeta
fix EXIF-rotated images shown cropped in previews, closes #4482JPEGs with EXIF orientation 5/6/7/8 were rendered cropped in themediamanager detail view, the image diff view and the fullscreendetail page: getimagesize() / JpegMeta report raw (rotation-unaware)pixel dimensions, and passing both w and h to fetch.php defaults tocenter-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.
Move PSR compliant tests to the apropriate namespacesHaving "inc" in the namespace is awkward. Instead the test classnamespaces now correspond to their real class namespaces.With further refacto
Move PSR compliant tests to the apropriate namespacesHaving "inc" in the namespace is awkward. Instead the test classnamespaces now correspond to their real class namespaces.With further refactorings we should get rid of most of the stuff intests/incthis is a continuation of #3812