Discussion:
[KPhotoAlbum] Can't import
Dave Sill
2016-07-17 13:41:22 UTC
Permalink
New KPhotoAlbum user. Running 4.7.1 on Fedora 24.

KPhotoAlbum added my existing photos OK when I first started it but all
attempts to import new photos fail with, e.g.:

Unable to open '/home/dave/pics/P1040299.JPG' for reading.

Obviously, I have read access to the file:

$ ls -ld / /home /home/dave /home/dave/pics /home/dave/pics/P1040299.JPG
dr-xr-xr-x. 25 root root 4096 Jul 16 12:35 /
drwxr-xr-x. 12 root root 4096 Feb 3 17:10 /home
drwx------. 174 dave dave 36864 Jul 16 18:36 /home/dave
drwxrwxr-x. 2 dave dave 4096 Jul 16 17:11 /home/dave/pics
-rw-r--r--. 1 dave dave 5041664 Jul 16 17:11 /home/dave/pics/P1040299.JPG
$

What am I missing?

-Dave
Johannes Zarl-Zierl
2016-07-17 19:10:04 UTC
Permalink
[resent for mailing list]
Do you use extended attributes on your file system?
lsattr only shows extents, no permission-related attributes.
Sorry, I meant ACLs (try "getfacl /home/dave/pics/P1040299.JPG").
I'm not seeing anything in the system logs. This is frustrating. It's got
to be something simple. This is a recent F23/KDE install upgraded to F24.
I just got home and checked the source code for the error message you gave.
Any chance you tried doing something like "kphotoalbum --import /home/dave/
pics/P1040299.JPG"?

If so, then the the fix is trivial:
"kphotoalbum --import importfile.kim" is for import files only. If you simply
want kphotoalbum to search for new images, start kphotoalbum and select
"Rescan for images and videos" from the maintenance menu.

If you want kphotoalbum to always search for new images on startup, you can
also check "Search for new images and videos on startup" in the settings.

HTH,
Johannes
Dave Sill
2016-07-18 01:53:16 UTC
Permalink
Post by Johannes Zarl-Zierl
"kphotoalbum --import importfile.kim" is for import files only. If you simply
want kphotoalbum to search for new images, start kphotoalbum and select
"Rescan for images and videos" from the maintenance menu.
Ah, thanks, Johannes. That makes sense. I'm used to photo managers having
an import function for extracting new photos from a camera or memory card.
So kphotoalbum doesn't have such a feature?

-Dave
Johannes Zarl-Zierl
2016-07-18 18:59:01 UTC
Permalink
Hi David,
Post by Dave Sill
[...}
Ah, thanks, Johannes. That makes sense.
Glad I could help you ;-)
Post by Dave Sill
I'm used to photo managers having
an import function for extracting new photos from a camera or memory card.
So kphotoalbum doesn't have such a feature?
No, kphotoalbum does not provide this.

If you want to have a device action "Import photos", you can add it manually.
To give you a starting point, something like this should work:

1. Create a shell script that does the import:
#!/bin/bash
MOUNTPOINT="$1"
IMAGE_SOURCE="$MOUNTPOINT/DCIM/*/*"
IMAGEDIR="/path/to/images"
YEAR=$(date +%Y)
IMPORTDATE=$(date +%F)
# ask the user for a name:
IMPORTNAME=$(kdialog --title "Choose album name" --inputbox "Specify an album name:" "$IMPORTDATE" )
# copy the images from the memory card:
kdecp5 "$IMAGE_SOURCE" "$IMAGEDIR/$YEAR/$IMPORTNAME"

2. Make the script file executable:
chmod +x ~/bin/import-photos.sh

3. Add a device action in the kde settings[1]:
kcmshell5 solid-actions
-> Add an appropriate action for your device and add the script you just created:
/path/to/bin/import-photos.sh "%f"


HTH,
Johannes

[1] https://techbase.kde.org/Development/Tutorials/Solid/Device_Actions
Loading...