5 Commits

Author SHA1 Message Date
4d256fbcfc maps.php
-correction mauvais chemin des vignettes
-correction affichage desciption dans la lightbox
2025-02-14 08:14:11 +01:00
356c1885df Mise-à-jour des traductions FR et ES 2025-02-13 18:05:47 +01:00
5638476d71 Suppression d’image 2025-02-13 18:03:25 +01:00
1ddd50ec90 Le dossier /thumb n’est plus suivi 2025-02-13 18:00:40 +01:00
f0fa8b6efc Version 1.1
-réécriture de la fonction create_thumb: pour les images format portrait, les vignettes sont redimensionner à 300px de large, puis cropées à 300x200. Toutes les vignettes sont au format paysage.
-quelques corrections de bugs
2025-02-13 17:38:01 +01:00
225 changed files with 558 additions and 430 deletions

Binary file not shown.

View File

@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: sur-le-sentier.fr\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-14 11:46+0100\n"
"PO-Revision-Date: 2024-12-14 13:41+0100\n"
"PO-Revision-Date: 2024-12-23 10:21+0100\n"
"Last-Translator: \n"
"Language-Team: French <bruno@clicclac.info>\n"
"Language: es_ES\n"
@@ -857,9 +857,8 @@ msgid "String"
msgstr "Cadena"
#: vegas/index.php:106
#, fuzzy
msgid "<span class=\"green\">Latest</span> images..."
msgstr "<span class=« green »>Últimas</span> imágenes…"
msgstr "<span class=« green»>Últimas</span> imágenes…"
#: view_bdd.php:101 view_bdd.php:155 view_bdd2.php:280 view_bdd2.php:306
msgid "Suppress"

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -80,7 +80,7 @@
</form>
</div>
<p class="navPage"><a href="index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a></p>
<p class="navPage"><a href="../index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="../photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="../maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a></p>
<p><em><small>&copy; 2013-<?php echo date('Y'); ?> sur-le-sentier.fr</small></em></p>

View File

@@ -108,16 +108,11 @@ $i = 1;
$photos = array();
foreach($dir as $file){
/*
$file->getFilename()
pathName()
*/
$file = $file->getpathName();
//$file = $file->getFilename();
echo $file;
$x = in_bdd($file);
echo $x;
/*
if ($i > 5) {
break;
@@ -653,6 +648,9 @@ try {
$titre = $item['title']; // ***
$legende = $item['legende']; // ***
# Create Thumbnails (functions.php line 203)
$big = $chemin . $file;
create_thumb($th_w, $th_h, $big);

View File

@@ -201,12 +201,49 @@ function get_gps($exif) {
function create_thumb($thumb_w, $thumb_h, $image) {
global $chemin;
list($origin_w, $origin_h) = getimagesize($image);
$origin_ratio = round($origin_w / $origin_h, 1);
$outFile = str_replace("../photos/img", "../photos/thumb", $image);
list($origin_w, $origin_h) = getimagesize($image);
$origin_ratio = round($origin_w / $origin_h, 1);
$outFile = str_replace("img", "thumb", $chemin) . basename($image);
if ($origin_w != null && $origin_h != null) {
$new_w = 300;
$new_h = 200;
//$f = $chemin . $image;
$thumb = new Imagick($image);
if ($origin_w != null && $origin_h != null) {
if ($origin_w > $origin_h) {
$resize_w = $origin_w * $new_h / $origin_h;
$resize_h = $new_h;
//$thumb->resizeImage($resize_w, $resize_h, Imagick::FILTER_LANCZOS, 0.9);
$thumb->resizeImage($resize_w, $resize_h, Imagick::FILTER_CATROM, 0.9);
}
else {
$resize_w = $new_w;
$resize_h = $origin_h * $new_w / $origin_w; // 450
$thumb->resizeImage($resize_w, $resize_h, Imagick::FILTER_CATROM, 0.9); // 300 x 300
$thumb->cropImage($new_w, $new_h, ($resize_w - $new_w) / 2, ($resize_h - $new_h) / 2); // (w, h, x ,y) (xy coin haut gauche) (300, 200, 0, 125)
}
//$image->sharpenimage($radius, $sigma, $channel); // 5, 1
$thumb->sharpenimage(5, 1);
$thumb->setImageCompression(Imagick::COMPRESSION_ZIP);
// Set compression level (1 lowest quality, 100 highest quality)
$thumb->setImageCompressionQuality(75);
// Strip out unneeded meta data
$thumb->stripImage();
$thumb->writeImage($outFile);
$thumb->destroy();
/*
if ($thumb_w / $thumb_h > $origin_ratio) {
$thumb_w = $thumb_h * $origin_ratio;
} else {
@@ -219,8 +256,11 @@ if ($origin_w != null && $origin_h != null) {
$image->writeImage($outFile);
$image->destroy();
}
*/
}
}
}
/* Fonction in_bdd(): test si la photo est déjà dans la bdd
@@ -228,8 +268,10 @@ if ($origin_w != null && $origin_h != null) {
*/
function in_bdd($image) {
global $base;
try {
$conn3 = new PDO('sqlite:../db_photo.sqlite3');
$conn3 = new PDO("sqlite:$base");
#$query3 = "SELECT filename FROM photos WHERE instr(filename, '". $file . "') > 0;";
$query3 = "SELECT filename FROM photos WHERE filename = :filename";
$stmt = $conn3->prepare($query3);
@@ -400,6 +442,11 @@ function data_for_lightbox($data) {
$longitude = $data['long'];
$altitude = $data['alt'];
$width = $data['width'];
$height = $data['height'];
//echo $width . "-" . $height;
$gps = (!empty($longitude) && !empty($latitude)) ? $latitude . "," . $longitude : "";
//$gps = $longitude . "," . $latitude;
@@ -488,6 +535,8 @@ function data_for_lightbox($data) {
$lightbox['creator'] = $creator;
$lightbox['gps'] = $gps;
$lightbox['description'] = $description;
$lightbox['width'] = $width;
$lightbox['height'] = $height;
/*
Array

View File

@@ -6,6 +6,10 @@ $domain = 'sentier';
localize($domain);
*/
include 'functions.php';
$base = 'db_photo.sqlite3';
$chemin = 'photos/img/';
$chemin_thumb = str_replace("img", "thumb", $chemin);
?>
<!DOCTYPE html>
<html lang="en">
@@ -54,7 +58,7 @@ include 'functions.php';
<?php
try {
$conn4 = new PDO('sqlite:db_photo.sqlite3');
$conn4 = new PDO("sqlite:$base");
$query4 = "SELECT filename, filesize, dateoriginal, lens, speed, correctexpo, iso, usercomment, comment, model, metering, flash, focal, program, wb, mode, width, height, html, aperture, software, lat, long, alt, keywords, title, creator, city, department, code, country, copyright, legende FROM photos WHERE lat != '' ORDER BY dateoriginal DESC";
$stmt = $conn4->prepare($query4);
@@ -119,7 +123,8 @@ include 'functions.php';
$lb = data_for_lightbox($result[$i]);
$b .= '[\'<div class="info_content"><h3>' . htmlspecialchars($lb['title_thumb'], ENT_QUOTES) . '</h3><div class="gm_thumb"><a href="' . $lb['big'] . '" title="' . htmlspecialchars($lb['title'], ENT_QUOTES) . '" data-lcl-txt="' . htmlspecialchars($lb['title'], ENT_QUOTES) . '" data-lcl-author="' . htmlspecialchars($lb['exif'], ENT_QUOTES) . '"><img src="' . $lb['thumb'] . '" /></a></div><p>' . htmlspecialchars($lb['title'], ENT_QUOTES) . '</p><p>' . htmlspecialchars($lb['legende'], ENT_QUOTES) . '</p><p>' . htmlspecialchars($lb['keywords'], ENT_QUOTES) . '</p></div>\'],' . "\r\n";
//$b .= '[\'<div class="info_content"><h3>' . htmlspecialchars($lb['title_thumb'], ENT_QUOTES) . '</h3><div class="gm_thumb"><a href="' . $lb['big'] . '" title="' . htmlspecialchars($lb['title'], ENT_QUOTES) . '" data-lcl-txt="' . htmlspecialchars($lb['title'], ENT_QUOTES) . '" data-lcl-author="' . htmlspecialchars($lb['exif'], ENT_QUOTES) . '"><img src="' . $lb['thumb'] . '" alt="' . htmlspecialchars($lb['title']) . '"></a></div><p>' . htmlspecialchars($lb['title'], ENT_QUOTES) . '</p><p>' . htmlspecialchars($lb['legende'], ENT_QUOTES) . '</p><p>' . htmlspecialchars($lb['keywords'], ENT_QUOTES) . '</p></div>\'],' . "\r\n";
$b .= '[\'<div class="info_content"><h3>' . htmlspecialchars($lb['title_thumb'], ENT_QUOTES) . '</h3><div class="gm_thumb"><a href="' . $lb['big'] . '" title="' . htmlspecialchars($lb['title']) . '" data-lcl-txt="' . htmlspecialchars($lb['description']) . '" data-lcl-author="' . htmlspecialchars($lb['creator']) . '"><img src="' . $lb['thumb'] . '" alt="' . htmlspecialchars($lb['title']) . '"></a></div><p>' . htmlspecialchars($lb['title'], ENT_QUOTES) . '</p><p>' . htmlspecialchars($lb['legende'], ENT_QUOTES) . '</p><p>' . htmlspecialchars($lb['keywords'], ENT_QUOTES) . '</p></div>\'],' . "\r\n";
}
$b = substr_replace($b, '', -3, 1);
echo $b;
@@ -174,23 +179,51 @@ include 'functions.php';
$(document).ready(function() {
var $obj = lc_lightbox('.gm_thumb a', {
img_zoom : true,
open_close_time : 200,
ol_time_diff : 100,
wrap_class : 'lcl_zoomin_oc',
skin : 'minimal', // minimal | light | dark
data_position : 'over',
cmd_position : 'inner',
txt_hidden : false,
//shox_title : true, // s'il faut afficher les titres
show_descr : false, // s'il faut afficher les descriptions
//show_author : true, // s'il faut afficher les auteurs
fullscreen : true,
fs_img_behavior : 'smart',
fs_only : 500,
browser_fs_mode : true,
txt_toggle_cmd : true,
rclick_prevent : true,
img_zoom : true, // whether to enable zooming system
author_by_txt : '<?php echo gettext("by"); ?>', // which text is used before the author name, by default is "by"
slideshow : true, // whether to enable slideshow
open_close_time : 200, // durée de l'animation pour l'ouverture et la fermeture de la lightbox
ol_time_diff : 100, // animation de superposition avance (à l'ouverture) et retard (à la fermeture) à la fenêtre
fading_time : 50, // durée de l'animation de fondu des éléments
animation_time : 100,
slideshow_time : 4000, // durée de l'intervalle du diaporama
autoplay : false, // autoplay slideshow - bool
counter : false, // s'il faut afficher le compteur d'éléments
progressbar : false, // s'il faut afficher une barre de progression lors de l'exécution du diaporama
max_width : '95%', // largeur maximale de la lightbox
max_height : '95%', // hauteur maximale de la lightbox
ol_opacity : 0.7, // overlay opacity / value between 0 and 1
ol_color : '#111', // background color of the overlay
ol_pattern : false, // overlay patterns - insert the pattern name or false
wrap_class : 'lcl_fade_oc', // Classes personnalisées ajoutées au wrapper: effet à l'ouverture de la lb (lcl_fade_oc | lcl_zoomin_oc | lcl_rtl_oc)
skin : 'minimal', // minimal | light | dark
data_position : 'over', // Spécifie où les données des éléments seront affichées. Les modes disponibles sont :over, under|rside|lside
cmd_position : 'inner', // Déclare où les commandes doivent être affichées : inner|outer
ins_close_pos : 'normal', // set closing button position for inner commands - normal/corner
nav_btn_pos : 'normal', // Régle les flèches et la position de lecture/pause. Options disponibles: normal|middle
txt_hidden : true, // whether to hide texts on lightbox opening - bool or int (related to browser's smaller side)
shox_title : true, // s'il faut afficher les titres
show_descr : true, // s'il faut afficher les descriptions
show_author : true, // s'il faut afficher les auteurs
thumbs_nav : false, // permet la navigation par vignettes (nécessite des éléments affiche ou images)
fullscreen : true, // Autoriser ou non le mode plein écran
fs_img_behavior : 'smart', //Comportement de l'image en plein écran : fit|fill|smart
fs_only : 500, // s'il faut utiliser uniquement l'ouverture de la lightbox en mode plein écran (utile pour les appareils mobiles) : false | (integer)
browser_fs_mode : true, // utiliser ou non le mode plein écran du navigateur
txt_toggle_cmd : true, // s'il faut afficher le bouton de basculement du texte de l'élément
download : true, // whether to show element's file download button
autoplay_videos : false, // bool / whether to autoplay videos (NB: modern browsers ignore this for deeplinked elements. Not applied if video has poster)
touchswipe : true, // permet les interactions tactiles (nécessite AlloyFinger)
rclick_prevent : true, // s'il faut éviter le clic droit sur les éléments de la lightbox
});
});

View File

@@ -56,6 +56,7 @@ else $page = intval($_GET['page']);
<?php
$chemin = 'photos/img/';
$chemin_thumb = str_replace("img", "thumb", $chemin);
$base = 'db_photo.sqlite3';
@@ -189,11 +190,32 @@ else exit("Database " . $base . " does not exist !");
$meta = '';
}
echo '<div class="item">';
echo '<a href ="' . $lb['big'] . '" title="' . htmlspecialchars($lb['title']) . '" data-lcl-txt="' . htmlspecialchars($lb['description']) . '" data-lcl-author="' . htmlspecialchars($lb['creator']) . '">';
/*
if ($lb['width'] > $lb['height']) {
echo '<img src="' . $lb['thumb'] . '" alt="' . htmlspecialchars($lb['title']) . '">';
}
else {
$f = $chemin . $result[$i]['filename'];
$image = new Imagick($f);
$new_w = 300;
$new_h = 200;
$resize_w = $new_w;
$resize_h = $lb['height'] * $new_w / $lb['width']; // 450
$image->resizeImage($resize_w, $resize_h, Imagick::FILTER_LANCZOS, 0.9); // 300 x 300
$image->cropImage($new_w, $new_h, ($resize_w - $new_w) / 2, ($resize_h - $new_h) / 2); // (w, h, x ,y) (xy coin haut gauche) (300, 200, 0, 125)
$thu = $chemin_thumb ."_" . $result[$i]['filename'];;
$image->writeImage($thu);
echo '<img src="' . $thu . '" alt="' . htmlspecialchars($lb['title']) . '">';
}
*/
echo '<img src="' . $lb['thumb'] . '" alt="' . htmlspecialchars($lb['title']) . '">';
echo "</a>";
echo '<span class="caption">' . month($date) . '</span>';

Binary file not shown.

Before

Width:  |  Height:  |  Size: 333 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 330 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 433 KiB

After

Width:  |  Height:  |  Size: 894 KiB

BIN
photos/img/12_2024.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 943 KiB

BIN
photos/img/1_2025.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

Some files were not shown because too many files have changed in this diff Show More