maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   How to open several images? Through dbus? (https://talk.maemo.org/showthread.php?t=28954)

luis 2009-05-13 03:13

How to open several images? Through dbus?
 
Hi,
I am trying to open a list of images using the image-viewer. I have tried this:

/usr/bin/dbus-send --print-reply --dest=com.nokia.image_viewer /com/nokia/image_viewer com.nokia.image_viewer.mime_open string:file://{file1,file2,file3}

this:

/usr/bin/dbus-send --print-reply --dest=com.nokia.image_viewer /com/nokia/image_viewer com.nokia.image_viewer.mime_open string:file://{file1,file2,file3}

this:

/usr/bin/dbus-send --print-reply --dest=com.nokia.image_viewer /com/nokia/image_viewer com.nokia.image_viewer.mime_open string:file:///dir/{file1,file2,file3}

without success. The third form works for the mediaplayer application... I even tried this:

/usr/bin/dbus-send --print-reply --dest=com.nokia.image_viewer /com/nokia/image_viewer com.nokia.image_viewer.mime_open string:file:///dir/{file1}

without success either. The only thing that works is:

/usr/bin/dbus-send --print-reply --dest=com.nokia.image_viewer /com/nokia/image_viewer com.nokia.image_viewer.mime_open string:file:///file1

that is, with 1 file. But this is not useful to me, I need to open a list of files. How to do it?

Thanks!!!

Cheers,
L.

buurmas 2009-10-16 18:15

Re: How to open several images? Through dbus?
 
I was researching this b/c I had what I thought was a similar need from a user perspective. If I had my N810 and someone asked me if I had any photos of my kids, I wanted to be able to press two buttons and have it up on my screen in a non-anti-social amount of time. :p

Your last syntax was exactly what I wanted for Personal Menu. It opens one photo, but then I can scroll through the rest of images in that folder. So I guess you could say that I created my "list" by putting all the relevant files in the same folder. I'm not not aware that Image Viewer has any other "list" concept or way of iterating through photos.

danielwilms 2009-10-19 07:49

Re: How to open several images? Through dbus?
 
Hi,

if you are developing in C/C++ you could include the hildon-mime.h header, which is placed in (/usr/include) and use this method:

Code:

gint              hildon_mime_open_file_list (DBusConnection    *con, GSList            *files);
Cheers Daniel

qiet72 2010-07-06 08:16

Re: How to open several images? Through dbus?
 
Hi,

I don't know if it can open multiple images, but the display command from the imagemagick package also displays images via command line and it works for me instead of a complex dbus command.

qiet72

dscobsct 2010-09-28 21:50

Re: How to open several images? Through dbus?
 
so what could i use to put in dbus switchboard to open an image, but to then be able to swipe through the rest of the images in the same folder as the one i opened. i tried the one above but it says file format not supported, how could i modify it to work.

kureyon 2010-09-29 15:51

Re: How to open several images? Through dbus?
 
You need to give the actual name of a file like so:

Code:

/usr/bin/dbus-send --print-reply --dest=com.nokia.image_viewer /com/nokia/image_viewer com.nokia.image_viewer.mime_open string:file:///media/mmc1/DCIM/p100001.jpg
However this only shows a single photo, even if in the image viewer you backup into the directory it will only list that single specified photo.

What you need to do is give it a directory:

Code:

/usr/bin/dbus-send --print-reply --dest=com.nokia.image_viewer /com/nokia/image_viewer com.nokia.image_viewer.mime_open string:file:///media/mmc1/DCIM/
Then when image viewer appears you need to swipe it once or twice to actually get it to start displaying the photos, otherwise it will just sit there pretending to be busy.

cHeXs7eR 2016-08-31 19:39

Re: How to open several images? Through dbus?
 
I have just taken the code and optimized it into a small shell script. You can check it out here :D


All times are GMT. The time now is 13:37.

vBulletin® Version 3.8.8