Android Coppermine Gallery Plugin and application (Upload Photos and Videos) - Page 2 Android Coppermine Gallery Plugin and application (Upload Photos and Videos) - Page 2
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Android Coppermine Gallery Plugin and application (Upload Photos and Videos)

Started by ISANexusDev, September 09, 2014, 07:14:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dimangelid

Hello,
I'm using Coppermine as me gallery for many years. I decided to try that plugin in order to give my users the ability to upload photos from their mobile phone. I have set up a bridge with my forum (MyBB) in order not to require double registrations. Probably the plugin can't use the bridge in order to login to the gallery and displays the message "Wrong username or password!" . When i press "Test Host" it displays "Host is OK!" . I don't want to deactivate the bridge and request from my users to make a double registration in order to use both the gallery and the forum. What can i do for that?

ISANexusDev

Quote from: dimangelid on March 26, 2015, 10:42:08 AM
Hello,
I'm using Coppermine as me gallery for many years. I decided to try that plugin in order to give my users the ability to upload photos from their mobile phone. I have set up a bridge with my forum (MyBB) in order not to require double registrations. Probably the plugin can't use the bridge in order to login to the gallery and displays the message "Wrong username or password!" . When i press "Test Host" it displays "Host is OK!" . I don't want to deactivate the bridge and request from my users to make a double registration in order to use both the gallery and the forum. What can i do for that?

Thank you for reporting this issue, I will look into it in detail and fix asap.

Can you tell how is your coppermine/mybb configuration. I mean:

* Is mybb bridged into coppermine as main service or other way around ( http://www.communityplugins.com/forum/forumdisplay.php?fid=6 )?
* mybb, coppermine and bridge (if applicable) versions.
* In the case you are using other than the coppermine official bridges (at admin->configure -> bridges) I would appreciate, if possible, a link from where I can download the coppermine<->mybb bridge, that you are using.

dimangelid

Quote from: ISANexusDev on March 26, 2015, 11:06:11 AM
Thank you for reporting this issue, I will look into it in detail and fix asap.

Can you tell how is your coppermine/mybb configuration. I mean:

* Is mybb bridged into coppermine as main service or other way around ( http://www.communityplugins.com/forum/forumdisplay.php?fid=6 )?
* mybb, coppermine and bridge (if applicable) versions.
* In the case you are using other than the coppermine official bridges (at admin->configure -> bridges) I would appreciate, if possible, a link from where I can download the coppermine<->mybb bridge, that you are using.

Hello and thank you for the quick reply :) Here are the answers you need:

1) The bridge between MyBB and Coppermine has been setup using the integrated Bridge feature of Coppermine.
2) Coppermine version is 1.5.20 and MyBB version is 1.6.11
3) This does not apply to my case, because i'm using the integrated Coppermine bridge feature.

If you need any other information, i'm glad to provide them ;)

ISANexusDev

Quote from: dimangelid on March 26, 2015, 06:09:56 PM

1) The bridge between MyBB and Coppermine has been setup using the integrated Bridge feature of Coppermine.
2) Coppermine version is 1.5.20 and MyBB version is 1.6.11
3) This does not apply to my case, because i'm using the integrated Coppermine bridge feature.

If you need any other information, i'm glad to provide them ;)

Thank you, this info is enough to reproduce your environment, find the problem and fix it. I'll come back to you in some days with a solution (I hope)  :)

ISANexusDev

Quote from: dimangelid on March 26, 2015, 10:42:08 AM
Hello,
I'm using Coppermine as me gallery for many years. I decided to try that plugin in order to give my users the ability to upload photos from their mobile phone. I have set up a bridge with my forum (MyBB) in order not to require double registrations. Probably the plugin can't use the bridge in order to login to the gallery and displays the message "Wrong username or password!" . When i press "Test Host" it displays "Host is OK!" . I don't want to deactivate the bridge and request from my users to make a double registration in order to use both the gallery and the forum. What can i do for that?

I have implemented new functionality in order to support MyBB bridge. I tried in my test environment and looks like it works. Still, you can test it better before I release a new AndroidCPG version.

I attach a Zip file where you can find the APK (you'll need to uninstall your previous AndroidCPG version from your android device and install this one) and also inside the zip there is another zip for the server (androidcpg_coppermine_plugin_bridge_beta.zip), you need to install this zip file as a plugin or extract its contents to your gallery plugins sub-directory.

Once done, normal login in AndroidCPG should success. Also image/video/remote_video uploading should work.

You might see (from server's plugin code) that, at the moment, everything is tailored for MyBB bridge. No other bridge (except MyBB and the default_coppermine_bridge<meaning:no bridge>) will work with AndroidCPG in this beta version.

Please, give some feedback

dimangelid

Quote from: ISANexusDev on March 27, 2015, 07:57:16 PM
I have implemented new functionality in order to support MyBB bridge. I tried in my test environment and looks like it works. Still, you can test it better before I release a new AndroidCPG version.

I attach a Zip file where you can find the APK (you'll need to uninstall your previous AndroidCPG version from your android device and install this one) and also inside the zip there is another zip for the server (androidcpg_coppermine_plugin_bridge_beta.zip), you need to install this zip file as a plugin or extract its contents to your gallery plugins sub-directory.

Once done, normal login in AndroidCPG should success. Also image/video/remote_video uploading should work.

You might see (from server's plugin code) that, at the moment, everything is tailored for MyBB bridge. No other bridge (except MyBB and the default_coppermine_bridge<meaning:no bridge>) will work with AndroidCPG in this beta version.

Please, give some feedback

I just tried your fix. It connects perfectly to Coppermine but when i get the window that asks to select an album, none of the buttons do anything and the album list is not displayed. I tried to press them many times, change my screen orientation but nothing. My phone is a LG Optimus G Pro with Android 4.4.2 and it is rooted.

ISANexusDev

Quote from: dimangelid on March 28, 2015, 01:38:39 AM
...none of the buttons do anything and the album list is not displayed...

Ok, I compiled an improved version for previous APK, this one will inform you what is the problem at ShareActivity. In your case, you are experiencing one of these problems:


  • Login doesn't success at ShareActivity: you will see a Toast saying "Wrong username or password!". To solve this problem you can try enabling "Double login" preference.
  • Album fetch doesn't success at ShareActivity: you will see a Toast saying "Failed fetching albums!"
  • Coppermine plugin returns inconsistent data:

  • Category id or Category position not set.
  • Can't create albums and No albums. In this is the case, be sure that your coppermine account is album creation capable OR it has at least 1 album assigned for file uploads.

In all these cases, a "Show Result" button will appear and when you hit it, a textbox with detailed information will appear.

If you got that "Show Result" button, please, hit it and try to figure out what is wrong. If it is too complicated to figure out, then press the "Copy Text" and write that output to this thread (deleting any information that you consider private: IPs...)

This is how I set up my test environment:


  • Vanilla Coppermine 1.5.2 (at web server root)
  • Vanilla MyBB 1.6.16 (latest 1.6 series MyBB Forum version) (at web server root/BBForum)
  • Created both at Coppermine and MyBB same account: test/test
  • At Coppermine configured test account to have proper upload/album access rights/limits
  • Set up MyBB bridge, with cookies path "/" both at coppermine and MyBB

Then:


  • I logged in with AndroidCPG
  • I created an album with AndroidCPG's Share activity (checked at server side that album was created and linked to the coppermine's "test" account)
  • I Uploaded the file with AndroidCPG's Share activity (checked at server side that the file was uploaded and linked to the coppermine's "test" account under the previous created album)

So, don't worry. It is going to work for you too  :)
[/list]


dimangelid

Quote from: ISANexusDev on March 28, 2015, 11:54:51 AM
Ok, I compiled an improved version for previous APK, this one will inform you what is the problem at ShareActivity. In your case, you are experiencing one of these problems:


  • Login doesn't success at ShareActivity: you will see a Toast saying "Wrong username or password!". To solve this problem you can try enabling "Double login" preference.
  • Album fetch doesn't success at ShareActivity: you will see a Toast saying "Failed fetching albums!"
  • Coppermine plugin returns inconsistent data:

  • Category id or Category position not set.
  • Can't create albums and No albums. In this is the case, be sure that your coppermine account is album creation capable OR it has at least 1 album assigned for file uploads.

In all these cases, a "Show Result" button will appear and when you hit it, a textbox with detailed information will appear.

If you got that "Show Result" button, please, hit it and try to figure out what is wrong. If it is too complicated to figure out, then press the "Copy Text" and write that output to this thread (deleting any information that you consider private: IPs...)

This is how I set up my test environment:


  • Vanilla Coppermine 1.5.2 (at web server root)
  • Vanilla MyBB 1.6.16 (latest 1.6 series MyBB Forum version) (at web server root/BBForum)
  • Created both at Coppermine and MyBB same account: test/test
  • At Coppermine configured test account to have proper upload/album access rights/limits
  • Set up MyBB bridge, with cookies path "/" both at coppermine and MyBB

Then:


  • I logged in with AndroidCPG
  • I created an album with AndroidCPG's Share activity (checked at server side that album was created and linked to the coppermine's "test" account)
  • I Uploaded the file with AndroidCPG's Share activity (checked at server side that the file was uploaded and linked to the coppermine's "test" account under the previous created album)

So, don't worry. It is going to work for you too  :)
[/list]

I installed the attached .APK and it is working perfectly, only with Double Login. I noticed another problem: When i insert greek characters either at the image title or at image caption, these are not displayed in the added photo at the gallery. Latin characters or numbers are displayed perfectly. Here is the greek alphabet, in order to try it yourself if you want: αβγδεζηθικλμνξοπρσςτυφχψω . Also i would like to make a feature request: my gallery is a bus photos gallery and we have setup custom fields at coppermine in order our users to include the vehicle license plate, fleet number etc. Is it possible your application to retrieve these custom fields from coppermine, in order each user to be able to complete them?

ISANexusDev

Quote from: dimangelid on March 28, 2015, 01:50:51 PM
I installed the attached .APK and it is working perfectly, only with Double Login. I noticed another problem: When i insert greek characters either at the image title or at image caption, these are not displayed in the added photo at the gallery. Latin characters or numbers are displayed perfectly. Here is the greek alphabet, in order to try it yourself if you want: αβγδεζηθικλμνξοπρσςτυφχψω . Also i would like to make a feature request: my gallery is a bus photos gallery and we have setup custom fields at coppermine in order our users to include the vehicle license plate, fleet number etc. Is it possible your application to retrieve these custom fields from coppermine, in order each user to be able to complete them?

Glad to hear that it worked for you!

About the Greek characters, I will investigate... Just one question, which "Collation" are your table fields? you can see this, as example, with phpmyadmin -> your coppermine database -> pictures table -> structure, see the title and  caption fields' collations. It would be nice to have them in a generic UTF8/UTF16 encoding, but well, don't change it if you are not completely sure what you are doing (you could damage/corrupt your database current data). As said, I will investigate if the problem comes at android encoding level.

About those vehicle extra fields, it would be better that you contact me privately (through this forum private message system) so we find out a way to implement and test this feature properly. It will be a pleasure to contribute, with my little piece of help, to Greece. From here my support to all of you and your fight for human rights and dignity. Long life to the Hellenic Republic! :)

BTW: Reading you came to my mind that AndroidCPG language support is limited right now to English and Spanish. Those of you who want to contribute to translations are very welcome. I attach the latest translation files, even the most appropriate would be to go to the repository ( https://code.google.com/p/androidcpg/source/browse/#git%2FAndroid%2Fres%2Fvalues ), fetch them (strings.xml and strings_activity_login.xml) directly from there, translate them and post them in this thread for me to handle them in a future version. Anyone doing this will be thanked and honored in the application credits :)

dimangelid

Quote from: ISANexusDev on March 28, 2015, 02:25:44 PM
Glad to hear that it worked for you!

About the Greek characters, I will investigate... Just one question, which "Collation" are your table fields? you can see this, as example, with phpmyadmin -> your coppermine database -> pictures table -> structure, see the title and  caption fields' collations. It would be nice to have them in a generic UTF8/UTF16 encoding, but well, don't change it if you are not completely sure what you are doing (you could damage/corrupt your database current data). As said, I will investigate if the problem comes at android encoding level.

About those vehicle extra fields, it would be better that you contact me privately (through this forum private message system) so we find out a way to implement and test this feature properly. It will be a pleasure to contribute, with my little piece of help, to Greece. From here my support to all of you and your fight for human rights and dignity. Long life to the Hellenic Republic! :)

BTW: Reading you came to my mind that AndroidCPG language support is limited right now to English and Spanish. Those of you who want to contribute to translations are very welcome. I attach the latest translation files, even the most appropriate would be to go to the repository ( https://code.google.com/p/androidcpg/source/browse/#git%2FAndroid%2Fres%2Fvalues ), fetch them (strings.xml and strings_activity_login.xml) directly from there, translate them and post them in this thread for me to handle them in a future version. Anyone doing this will be thanked and honored in the application credits :)

I will contact you as soon as possible for my feature request. I thank you very much for your support to our country and wish you the best :) The Greek translation is ready from me ;)

ISANexusDev

Quote from: dimangelid on March 28, 2015, 03:46:02 PM
The Greek translation is ready from me ;)

Here I attach the app (beta3) with your Greek translation and full UTF8 support. So, titles and captions should work correctly for Greek and other languages including non-ascii characters in their alphabets. Also album names, usernames and passwords go in UTF8.

Translations credits activity will be added in the official incoming version. Until that, receive this formal "thanks!"

PS: If you see any misspelling/grammar defect don't hesitate to contact for corrections.


dimangelid

Quote from: ISANexusDev on March 28, 2015, 04:19:17 PM
Here I attach the app (beta3) with your Greek translation and full UTF8 support. So, titles and captions should work correctly for Greek and other languages including non-ascii characters in their alphabets. Also album names, usernames and passwords go in UTF8.

Translations credits activity will be added in the official incoming version. Until that, receive this formal "thanks!"

PS: If you see any misspelling/grammar defect don't hesitate to contact for corrections.

I tried it now and both my translation and greek characters at title and caption work great! I also upload an edited version of strings_activity_login.xml because i detected a misspell. Thank you again very much for your help :) :) :)

ISANexusDev

Before I upload the changes to F-Droid I wanted to upload here the APK, plugin and sources for version 1.5

I moved the project sources from googlecode to github, since googlecode is about to shutdown. Github address for AndroidCPG is:

https://github.com/IsaNexusDev/androidcpg

Changelog:

* Bridge support (only MyBB at the moment)
* UTF8 support (title, description, username, password, album name)
* Show Result button is visible at ShareActivity when login or fetch albums fails
* Greek Translation
* Translator credits at preferences.

To dimangelid: please download latest https://github.com/IsaNexusDev/androidcpg/raw/master/androidcpg_coppermine_plugin.zip and overwrite your coppermine androidcpg plugin folder with the code in this version, since the code at db_input.php at AndroidCPG_bridgeBB_beta.zip had some code that will not work with your server, this code:


    $failurewritting = false;
    $picture_name_ori = null;
    if (in_array($matches[2], array('avi','mp4','3gp','m4v','flv','mpeg','mpg','mov','3pg','webm','wmv'))){
        $picture_name_ori = $uploaded_pic;
        if ($matches[2] == 'mp4'){
            $uploaded_pic_new = str_replace('.mp4','_ori.mp4',$uploaded_pic);
            if (!rename($uploaded_pic,$uploaded_pic_new)) {
                if (copy ($uploaded_pic,$uploaded_pic_new)) {
                    //chmod($dbfilename, 664);
                    unlink($uploaded_pic);
                } else {
                    $failurewritting = true;
                }
            }
            if (!$failurewritting){
                $uploaded_pic = $uploaded_pic_new;
            }
        } else {
            $picture_name = str_replace('.'. $matches[2],'.mp4' ,$picture_name);
        }
        $thumb_name = 'thumb_' . str_replace('.mp4','.jpg' ,$picture_name);
if (!$failurewritting){
    $cmd = 'nohup nice -n 10  encodevideo.sh "'.$uploaded_pic.'" "'.$dest_dir .$picture_name.'" "'.$dest_dir.$thumb_name.'" > encodelogs/encode_'.$picture_name.'.log & printf "%u" $!';
            $pid = shell_exec($cmd);
        }
    }


As seen, I use this code for automatic video encode when user uploads a video... but, if encodevideo.sh is missing from the server you will end up in not a very good situation :)

My encodevideo.sh code, if anyone interested is:


#!/bin/bash
#
# REQUIRED:
#
# Handbrake installation:
#
# sudo add-apt-repository  ppa:stebbins/handbrake-releases
# sudo apt-get update
# sudo apt-get install handbrake-gtk handbrake-cli
#
# FFMpeg installation:
#
# sudo apt-get install ffmpeg
#
# Imagemagik installation:
#
# sudo apt-get install imagemagick
#


# mp4 encoding supported by most android/Iphone devices
HandBrakeCLI --width 800 --aencoder aac --ab 160 -6 stereo --arate 44.1 -e x264 -q 20 -a 1 --modulus 2 --loose-anamorphic --rate 29.97 -x 8x8dct=0:ref=1:bframes=0:cabac=0:me=umh:mixed_ref=0:chroma_me=1:threads=3:lookahead_threads=1:sliced_threads=0:nr=0:decimate=1:interlaced=0:bluray_compat=0:constrained_intra=0:weightp=0:keyint=300:keyint_min=30:scenecut=40:intra_refresh=0:rc=crf:crf=20,0:qcomp=0,60:qpmin=0:qpmax=69:qpstep=4:ip_ratio=1,40:aq=1:1,00:chroma_qp_offset=-2:deadzone=21,11:fast_pskip=1:rc_lookahead=50 -i "$1" -o "$2"
echo video reencoded "$2"

if [ -f "$3" ]
then
    echo the thumb already exists "$3"
else
    #ffprobe and ffmpeg are part of ffmpeg package
    d=$(ffprobe -v quiet -print_format compact=print_section=0:nokey=1:escape=csv -show_entries format=duration "$2" 2>&1 | grep -o -P ".*?(?=\.)")
    d=$(( d / 3))

    ffmpeg -i "$2" -y -r 1 -vframes 1 -ss "$d" "$3"
   
    #convert and composite is part of imagemagick package
    convert "$3" -resize 120x120 "$3"
   
    echo composite -compose atop -gravity center video_watermark.png "$3" "$3.tmp.jpg"
    composite -compose atop -gravity center video_watermark.png "$3" "$3.tmp.jpg"
    mv -f "$3.tmp.jpg" "$3"
   
    echo created thumb "$3"
fi


As seen, video transcoding and image preview extraction is performed. If video_watermark.png exists, then It will be overlaid in the preview image

Cynos

Hello,

Thank you for this plug in, it looks great.

I have an issue, I can't use it.

- install both plug in and apk was easy
- I tested I can access to the plug in with its own adress path
- When I try to use Androidcpg onto the mobile, it returns "host doesn't contain a coppermine gallery".

* I use joomla 3 and last release of CPG vith the joomla CPG tunnel.
* I don't yet have a domain attached to the site, but I can access with the server adress with no problem
* I can access to coppermine with two adresses
server_adress.fr/index.php/cpg (joomla wrapper using tunnel)
server_adress.fr/galerie (direct access, not using joomla cpg tunnel)
Of course I tried both adresses in androidcpg config onto the mobile, with same result.

Do you think the problem is because I don't still have a domain name attached to CPG ?
Or could it be something else ?

Thanks for help.

ISANexusDev

Quote from: Cynos on November 30, 2015, 11:20:52 AM
Hello,

Thank you for this plug in, it looks great.

I have an issue, I can't use it.

- install both plug in and apk was easy
- I tested I can access to the plug in with its own adress path
- When I try to use Androidcpg onto the mobile, it returns "host doesn't contain a coppermine gallery".

* I use joomla 3 and last release of CPG vith the joomla CPG tunnel.
* I don't yet have a domain attached to the site, but I can access with the server adress with no problem
* I can access to coppermine with two adresses
server_adress.fr/index.php/cpg (joomla wrapper using tunnel)
server_adress.fr/galerie (direct access, not using joomla cpg tunnel)
Of course I tried both adresses in androidcpg config onto the mobile, with same result.

Do you think the problem is because I don't still have a domain name attached to CPG ?
Or could it be something else ?

Thanks for help.

I think that the problem might be that you need to write an ending slash in the host address, something like this: h t t p://server_adress.fr/galerie/

Also, at h t t p://server_adress.fr/galerie/ should be at least these files: login.php, db_input.php, index.php and delete.php (as it should be in any Coppermine gallery installation folder).

If you are writing the host with the ending slash AND you are sure that the files (said before) are at that url AND still you are getting the same error then please poke me again. :-)

P.S. Most probably the address for joomla bridge to coppermine (h t t p://server_adress.fr/index.php/cpg/) won't work for AndroidCPG. But the direct access address to the gallery should be OK for AndroidCPG to work with no issues.

Cynos

hello, thanks for reply.

It still don't work, but I understand why now because of your previous post.

- As I said I don't have a domain name for the moment, because the website is still on developpement.

- So androidcpg is trying to access to a "http://adress", but because I use a server adress there's no "http://".
Acces for coppermine is server_adress.fr/galerie (without http://)

Well I need to wait a domain name attached to the website to know if I could use androidcpg.

I want to thant you for the plugin and the time you spent to answer to me.
When I will have the domain name, I will let you know if it works.

ISANexusDev

Quote from: Cynos on December 01, 2015, 12:19:04 AM
hello, thanks for reply.

It still don't work, but I understand why now because of your previous post.

- As I said I don't have a domain name for the moment, because the website is still on developpement.

- So androidcpg is trying to access to a "http://adress", but because I use a server adress there's no "http://".
Acces for coppermine is server_adress.fr/galerie (without http://)

Well I need to wait a domain name attached to the website to know if I could use androidcpg.

I want to thant you for the plugin and the time you spent to answer to me.
When I will have the domain name, I will let you know if it works.

Uhmm, I see... AndroidCPG has this logic for hostnames:

If host is provided with prefix http:// or https:// it will be respected as it is, but if the protocol is not given then AndroidCPG will default to http://, in other words, http:// will be added as prefix to the provided hostname in the text field.

Anyway, I think it is possible to connect to your CPG gallery with AndroidCPG without a domain name:

AndroidCPG will work if you connect your phone to your local network (as example connecting with WIFI) and you provide the CPG gallery's IPaddress, as example: h t t p://192.168.43.6/galerie/ , or even from outside your local network (with your phone's own internet connection), if this is your need, by redirecting your router's port to the computer hosting the gallery and connecting to your public IP address with something like this: h t t p://92.48.43.66/galerie/ configured as Host in AndroidCPG.

BTW, and even is not helpful for your case, there are free dynamicDNS services keeping your hostname's IP address updated with the help of scripts, as example: https://freedns.afraid.org , this service in particular is also giving you a free subdomain name, in case you need it. Something like http://androidcpg.mine.bz  ;)

Cynos

thanks again for answer and for your help.

- well, I will just wait a couple of day, domain name is not still buy, need to be chosen.
and so I will let you know.

- what your explained about local network is interesting, as I have a server at home with his own domain name attached ... if I find time, I will replicate the distant site onto this server and make some tests.

thank you.

Cynos

Hello, me again ...

So now the site is online and I have a domain name attached to it.

AndroidCPG plugin is installed on CPG config.
I tested AndroidCPG (androidcpg): v1.0 adress with the browser, and I can access to it:
http://domain_adress/galerie/plugins/androidcpg/login.php

I can access to my coppermine gallery with no problem on bot mobile browser or PC browser at; http://domain_adress/galerie/
All the files needed are ok (login.php, db_input.php, index.php,and delete.php).

I use the Theme switch (theme_switch): v1.0 plugin for mobile view.
I use Joomla_to_CPG_v1.2 plugin to synchronise joomla users to cpg users (Joomla 2x-3x to CPG Tunnel)

In the androidCPG app when I test the host (http://domain_adress/galerie/), it returns "host doesn't contain a coppermine gallery"

any advices please ?
thanks.