forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 plugins => Topic started by: vikler on October 06, 2014, 09:19:39 pm

Title: Problem with "Pic_download_link" plugin in one of custom themes
Post by: vikler on October 06, 2014, 09:19:39 pm
Hi everyone. I seem to have problem with using "Pic_download_link" plugin in one of my custom themes. I can click the link, and the download starts. But I can't open image, it says I have a corrupted jpg.
Anyway, here is the link to the theme that seems problematic:
http://dane-dehaan.org/photos/displayimage.php?theme=omm_cpg18&album=322&pid=19472#top_display_media
try clicking on "Download HQ photo": you will face the problem described above
And on other themes it works well, the downloaded image can be opened and viewed:
http://dane-dehaan.org/photos/displayimage.php?theme=dane&album=322&pid=19472#top_display_media
Title: Re: Problem with "Pic_download_link" plugin in one of custom themes
Post by: ron4mac on October 07, 2014, 12:30:58 am
There is a LF character (0x0A) prepended to the file when downloaded from the problem theme. I suspect that somewhere the theme code is unnecessarily outputting a linefeed character before the plugin gets a chance to send the file. Suspect areas to look for are extra lines after the closing ?> of a .php file. It's generally best to just delete the ?> at the end of php files.
Title: Re: Re: Problem with "Pic_download_link" plugin in one of custom themes
Post by: vikler on October 07, 2014, 12:42:49 am
There is a LF character (0x0A) prepended to the file when downloaded from the problem theme. I suspect that somewhere the theme code is unnecessarily outputting a linefeed character before the plugin gets a chance to send the file. Suspect areas to look for are extra lines after the closing ?> of a .php file. It's generally best to just delete the ?> at the end of php files.
thanks for your reply, however I can't find where the located LF character is :( I don't use php's in this theme, it's just template.html. My theme.php is empty.
Any tips on how I find the LF character and get rid of it?:(
Title: Re: Problem with "Pic_download_link" plugin in one of custom themes
Post by: ron4mac on October 07, 2014, 01:47:40 am
your theme.php needs to be at least one line:
Code: [Select]
<?php
Title: Re: Re: Problem with "Pic_download_link" plugin in one of custom themes
Post by: vikler on October 07, 2014, 01:49:56 am
your theme.php needs to be at least one line:
Code: [Select]
<?php
:) that fixed my problem. thanks so much!