diff --git a/src/components/Map/markerManager.js b/src/components/Map/markerManager.js index 264a7b7..3f25375 100644 --- a/src/components/Map/markerManager.js +++ b/src/components/Map/markerManager.js @@ -789,9 +789,10 @@ function collectGalleryImages(post) { const seen = new Set(); const seenBase = new Set(); // Get base filename without size suffix to detect same image in different sizes + // Handles both long (_large, _medium, _small) and short (_l, _m, _s) variants const getBase = (url) => { if (!url) return ''; - return url.replace(/[-_](large|medium|small|thumb|thumbnail)(\.[^.]+)?$/i, '$2') + return url.replace(/[-_](large|medium|small|thumb|thumbnail|l|m|s)(\.[^.]+)?$/i, '$2') .replace(/\?.*$/, ''); // Remove query params }; const add = (value) => { diff --git a/src/components/Posts/PostDetailModal.jsx b/src/components/Posts/PostDetailModal.jsx index d2fda3f..52205ea 100644 --- a/src/components/Posts/PostDetailModal.jsx +++ b/src/components/Posts/PostDetailModal.jsx @@ -585,14 +585,15 @@ export default function PostDetailModal({ post, onClose, onPostUpdated, onPostDe const config = getCategoryConfig(post?.category); const author = post?.author || post?.username || post?.source_name || t("common.anon"); - // Media gallery - dedupe by base filename (ignore size variants like _large, _medium, _small) + // Media gallery - dedupe by base filename (ignore size variants like _large, _medium, _small, _l, _m, _s) const gallery = useMemo(() => { const seen = new Set(); const seenBase = new Set(); const images = []; const getBase = (url) => { // Remove size suffixes to detect same image in different sizes - return url.replace(/[-_](large|medium|small|thumb|thumbnail)(\.[^.]+)?$/i, '$2') + // Handles both long (_large, _medium, _small) and short (_l, _m, _s) variants + return url.replace(/[-_](large|medium|small|thumb|thumbnail|l|m|s)(\.[^.]+)?$/i, '$2') .replace(/\?.*$/, ''); // Remove query params }; const add = (url) => {