Piwigo / piwigo-openstreetmap

OpenStreetMap integration for Piwigo
http://piwigo.org/ext/extension_view.php?eid=701
GNU General Public License v3.0
35 stars 35 forks source link

Wrong url's thumbnails when use points at directory #60

Open diegoleonuy opened 9 years ago

diegoleonuy commented 9 years ago

In http://192.168.2.79/FotosTEL/osmmap.php?/category/306&v=2 not display the thumbnails pictures.

Tries to show a thumbnail image from http://192.168.2.79/FotosTEL/i.php?/galleries/Cerro%20Largo/Loc-sq.JPG but not working.

Should try to search at

http://192.168.2.79/FotosTEL/i.php?/galleries/Cerro%20Largo/Loc.Melo/ReclamoProseco/DSC00166-sq.JPG

That works.

I use this regex:

$conf['sync_chars_regex'] = '/^[a-zA-Z0-9-_. áéíóúÁÉÍÓÚñÑ()°`,+]+$/';
Amgine0 commented 9 years ago

The IP address is local to your network, and not available via the internet. We cannot see what you wish us to see.

diegoleonuy commented 9 years ago

Yes. Is my intranet. Look at the malformed URL is truncated at the point: Loc.Melo

diegoleonuy commented 9 years ago

captura

Amgine0 commented 9 years ago

Yes, sorry. I misunderstood the issue.

xbgmsharp commented 9 years ago

Could you try using the latest git version, https://github.com/xbgmsharp/piwigo-openstreetmap#installation A few issue has been fixed as per changelog, https://github.com/xbgmsharp/piwigo-openstreetmap/compare/v2.7.c...master

If I understand the issue, the thumbnail in the rubban are like: http://192.168.2.79/FotosTEL/i.php?/galleries/Cerro%20Largo/Loc-sq.JPG but it should be like: http://192.168.2.79/FotosTEL/i.php?/galleries/Cerro%20Largo/Loc.Melo/ReclamoProseco/DSC00166-sq.JPG

Your photos album is having a . in the name. Is it a virtual or a real folder.

Looks like the issue is in the MYSQL query, https://github.com/xbgmsharp/piwigo-openstreetmap/blob/master/include/functions_map.php#L191 The . is use to parse the the extension from parsing the path.

xbgmsharp commented 9 years ago

If we can assume that file is always include in path. We could replace the L191 from: CONCAT(SUBSTRING_INDEX(TRIM(LEADING '.' FROM i.path), '.', 1 ), '-sq.', SUBSTRING_INDEX(TRIM(LEADING '.' FROM i.path), '.', -1 )),

to

CONCAT( REPLACE(TRIM(LEADING '.' FROM i.path), i.file, ''), SUBSTRING_INDEX(i.file, '.', 1 ), '-sq.', SUBSTRING_INDEX(TRIM(LEADING '.' FROM i.path), '.', -1 ) ),

diegoleonuy commented 9 years ago

Perfect! I replaced the line 191 in the file /plugins/openstreetmap/include/functions_map.php Problem solved. Thank you very much.