diff --git a/module/album/album.php b/module/album/album.php index 02f8c12..ab0109b 100644 --- a/module/album/album.php +++ b/module/album/album.php @@ -5,7 +5,7 @@ */ setlocale(LC_NUMERIC,'English','en_US','en_US.UTF-8'); class album extends common { - const VERSION = '2.6'; + const VERSION = '3.0'; const REALNAME = 'Album Photo'; const DELETE = true; const UPDATE = '0.0'; diff --git a/module/album/plugins/thumbnailer.php b/module/album/plugins/thumbnailer.php index 2058b8c..c164992 100644 --- a/module/album/plugins/thumbnailer.php +++ b/module/album/plugins/thumbnailer.php @@ -1,6 +1,6 @@ $hauteur) - { - $im = imagecreatetruecolor(round(($ratio/$hauteur)*$largeur), $ratio); - imagecopyresampled($im, $src, 0, 0, 0, 0, round(($ratio/$hauteur)*$largeur), $ratio, $largeur, $hauteur); - } - else - { - $im = imagecreatetruecolor($ratio, round(($ratio/$largeur)*$hauteur)); - imagecopyresampled($im, $src, 0, 0, 0, 0, $ratio, round($hauteur*($ratio/$largeur)), $largeur, $hauteur); - } - imagewebp($im, $miniature, 80); - imagedestroy($im); +if (!file_exists($miniature)) { +list($width, $height, $type, $attr) = getimagesize($img); + +if ($height > $tnhaut) +{ +$convert = $tnhaut/$height; +$height = $tnhaut; +$width = ceil($width*$convert); +} +if ($width > $tnlarge) +{ +$convert = $tnlarge/$width; +$width = $tnlarge; +$height = ceil($height*$convert); +} + +$largeur = $width; +$hauteur = $height; + +if($type == 1) +{ + $img_in = imagecreatefromgif($img); +} +elseif($type == 2) +{ + $img_in = imagecreatefromjpeg($img); +} +elseif($type == 3) +{ + $img_in = imagecreatefrompng($img); +} +elseif($type == 18) +{ + $img_in = imagecreatefromwebp($img); +} +imageinterlace($img_in, true); + +$img_out = imagecreatetruecolor($largeur, $hauteur) or die ('Impossible de créer un flux d\'image GD'); +imagecopyresampled($img_out, $img_in, 0, 0, 0, 0, imagesx($img_out), imagesy($img_out), imagesx($img_in), imagesy($img_in)); + + imagewebp($img_out, $miniature, 80); + imagedestroy($img_out); } header('Content-Type: image/webp'); $data = file_get_contents($miniature); diff --git a/module/album/view/gallery/gallery.css b/module/album/view/gallery/gallery.css index e424aa3..c94e371 100644 --- a/module/album/view/gallery/gallery.css +++ b/module/album/view/gallery/gallery.css @@ -1,14 +1,20 @@ -.gallery { +section > * { + box-sizing: border-box; + padding: 0; +} +section > .row:not(.back) > .col2 { padding: 5px; +} +.gallery { position: relative; } .galleryGalleryPicture { + box-sizing: content-box; + padding: 12px 0 2px; display: flex; align-items: center; justify-content: center; position: relative; - height: 185px;/*fluide*/ - max-height: 36vmin; text-align: center; background-color: rgba(230, 230, 230, 0.7); border: 1px solid #ddd; @@ -19,59 +25,48 @@ background-color: rgb(192, 192, 192); } .galleryGalleryName { - position: absolute; - left: 0; - right: 0; - bottom: 0; line-height: 1.2; - color: #000; - overflow: hidden; - font-size: 0.85em; } -.galleryGalleryPicture img { - max-height: 80%; +.galleryGalleryPicture > figure > img { + max-height: 20vmin; max-width: 95%; + object-fit: contain; } .picResized { color: crimson; } .osm { position: absolute; - left:10px; - bottom:10px; + right:10px; + top:10px; } -/* adaptation */ -@media (max-width: 1281px) { -.galleryGalleryPicture { - height: 160px; - } +figure, figcaption { + border: none; + margin: 0; + padding: 0; } + /* styles adaptatifs */ + @media (max-width: 1025px) { -.galleryGalleryPicture { - height: 135px; -} .galleryGalleryName { - font-size: 0.75em; + font-size: 0.78em; } } -@media (max-width: 813px) { -.galleryGalleryPicture { - height: 120px; -} -} + @media (max-width: 799px) { section > .row:not(.back) { display: flex; flex-wrap: wrap; - padding: 0 10px; + justify-content: space-evenly; } .gallery { flex: 0 0 33.3333%; } -.col2:not(.gallery) { - width: inherit; +.galleryGalleryPicture > figure > img { + max-height: 25vmin; } } + @media (max-width: 599px) { .gallery { flex: 0 0 50%; @@ -79,4 +74,7 @@ section > .row:not(.back) { .galleryGalleryName { display: none; } -} \ No newline at end of file +.galleryGalleryPicture { + padding: 12px 0 7px; +} +} diff --git a/module/album/view/gallery/gallery.js.php b/module/album/view/gallery/gallery.js.php index 2888843..d937609 100644 --- a/module/album/view/gallery/gallery.js.php +++ b/module/album/view/gallery/gallery.js.php @@ -9,30 +9,3 @@ captionsData: "caption", closeText: "×" }); - - $(function () { - -var taille = "getData(['theme','site', 'width']); ?>"; - - switch(taille) - { - case '75vw': - $('a.galleryGalleryPicture').css('height', '125px'); - $('div.galleryGalleryName').css('font-size', '0.8em'); - $('div.galleryGalleryName').css('line-height', '1em'); - break; - case '85vw': - $('a.galleryGalleryPicture').css('height', '135px'); - $('div.galleryGalleryName').css('font-size', '0.85em'); - $('div.galleryGalleryName').css('line-height', '1em'); - break; - case '95vw': - $('a.galleryGalleryPicture').css('height', '160px'); - $('div.galleryGalleryName').css('font-size', '0.9em'); - break; - default: - $('a.galleryGalleryPicture').css('height', '185px'); - $('div.galleryGalleryName').css('font-size', '1em'); - break; - } -}); diff --git a/module/album/view/gallery/gallery.php b/module/album/view/gallery/gallery.php index 5aa2100..7325ee9 100644 --- a/module/album/view/gallery/gallery.php +++ b/module/album/view/gallery/gallery.php @@ -2,18 +2,7 @@ // Lexique $param = ''; include('./module/album/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_album.php'); -?> -
-
- 'buttonGrey', - 'href' => helper::baseUrl() . $this->getUrl(0), - 'ico' => 'left', - 'value' => $text['album_view']['gallery'][0] - ]); ?> -
-
- $legend): @@ -36,14 +25,14 @@ $get_location = albumHelper::gps_exif($picture);