Open ThomasDaheim opened 8 years ago
Could you please provide a screenshot? Question mark images are not from the plugin.
First screenshot: Questionmarks when viewing Gallery with gpx and kml file:
Second screenshot: kml file image view:
HTH,
Thomas
In the gallery, for GPX file you are suppose to have this icon. https://github.com/xbgmsharp/piwigo-openstreetmap/blob/master/mimetypes/gpx.png
Could you test using the latest github version.
Tried using the latest version. The gpx.png is present but still doesn't get shown.
The function call is osm_get_mimetype_icon
. Try to debug $element_info
and $location
.
https://github.com/xbgmsharp/piwigo-openstreetmap/blob/master/gpx.inc.php#L90
Maybe you change to support KML, break the mimetype.
I did a rollback of my changes to gpx.inc.php but still no icon :-(
As for debugging php: Might take a day or two until I learn how to do that...
I finally managed to have look into that. I added some print_r's into function osm_get_mimetype_icon($location, $element_info) and this is the output when looking at a gpx:
element_info: gpx - location: plugins/piwigo-openstreetmap/mimetypes/gpx.png
Looks pretty reasonable to me. Now the question is why the image isn't shown. Maybe I would need to enable ".png" somewhere as valid image extension?
The result is correct. No need to enable ".png" as valid image extension. On your gallery display the image HTML code using the inspector from the web development tools.
Also do you have any custom config from your webserver or PWG?
My config.inc.php:
<?php
/* The file does not exist until some information is entered
below. Once information is entered and saved, the file will be created. */
/* set time zone explicitly to avoid php warning */
date_default_timezone_set('Europe/Berlin');
/* no caption under thumbs, please! */
$conf['show_thumbnail_caption'] = false;
/* don't show filename on picture page */
$conf['show_picture_name_on_title'] = false;
/* show exif info */
$conf['show_exif_fields'] = array(
'Make',
'Model',
'latitude',
'longitude',
'FNumber',
'ExposureBiasValue',
'ExposureTime',
'ISOSpeedRatings',
'FocalLength',
'ExposureMode',
'MeteringMode',
'ExposureProgram',
);
/* load all file types - not only images
needed for gpx, see https://github.com/xbgmsharp/piwigo-openstreetmap/issues/50 */
$conf['upload_form_all_types'] = true;
$conf['use_exif'] = true;
/* allow spaces in file names */
$conf['sync_chars_regex'] = '/^[a-zA-Z0-9-_. ]+$/';
?>
My main.inc.php:
<?php
/*
Plugin Name: Personal Plugin
Version: 1.0
Description: Personal Plugin
Plugin URI: http://piwigo.org
Author: Thomas Feuster
Author URI:
*/
add_event_handler('loc_end_page_tail', 'perso_remove_contact_link_footer');
function perso_remove_contact_link_footer()
{
global $template;
$template->assign('CONTACT_MAIL', null); // core contact link
$template->assign('ContactFormLink', null); // ContactForm plugin link
}
/* hide standard about */
if (script_basename() == 'about')
{
add_event_handler('loc_end_page_header', 'nopiwigoabout');
}
function nopiwigoabout()
{
global $template;
$template->clear_assign('ABOUT_MESSAGE');
}
?>
In my gallery the HTML code is different:
Somehow in the end it is "unknown.png" that gets shown?
Are you on windows?
The OSM call set a mine-type otherwise the default unknown is used.
https://github.com/xbgmsharp/piwigo-openstreetmap/blob/master/gpx.inc.php#L90
In include/derivative.inc.php on line 74
You can try to add a debug print
for PHPWG_ROOT_PATH.$this->rel_path
before the IF
.
add another debug for the return value of getimagesize
, http://php.net/manual/en/function.getimagesize.php
You also make sure the _data/
to be writable by your webserver.
I have added print_r's and " - " as separator for readability.
- ./plugins/piwigo-videojs/mimetypes/gpx.png - Array ( [0] => 48 [1] => 48 [2] => 3 [3] => width="48" height="48" [bits] => 16 [mime] => image/png ) -
Path is to piwigo-videojs? AND there is no file gpx.png! For testing I have copied gpx.png to the piwigo-videojs folder and now it shows up correctly...
That is weird, the path should not be piwigo-videojs
It does return the path and the size alone with the mine-type.
Add print ($size=@getimagesize(PHPWG_ROOT_PATH.$this->rel_path))
I noticed that I had placed the print_r for size in the IF
... Here is the corrected output with empty output for $size=@getimagesize(PHPWG_ROOT_PATH.$this->rel_path)
:
- ./plugins/piwigo-videojs/mimetypes/kml.png - -
As said above - since the search path contains piwigo-videojs the gpx.png from your plugin won't be found. As crosscheck: manually copying it into the piwigo-videojs folder makes it appear correctly.
True, the path is wrong, eg: piwigo-videojs
. There is a conflict with other plugin.
The issue appears for GPX or KML file?
The VideoJS mine-type override should not reply, to any of the .gpx
or .kml
files
https://github.com/xbgmsharp/piwigo-videojs/blob/master/main.inc.php#L413
Try to disable the VideoJS plugin to ensure there is no conflict. On my prod and dev box, I have both plugin and no issue.
Happens for both gpx and kml files.
WORKS if the VideoJS plugin is disabled.
Hi,
in case of gpx files the thumb/picture is always shown as a question mark. Is there any way to modify that and replace by some placeholder image?
Thanks, Thomas