Bug 306371 - Rename with sequence number
Summary: Rename with sequence number
Status: RESOLVED WORKSFORME
Alias: None
Product: digikam
Classification: Applications
Component: AdvancedRename-file (show other bugs)
Version: 2.5.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-06 21:33 UTC by valar
Modified: 2022-01-31 21:57 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 3.0.0
Sentry Crash Report:


Attachments
kcrash dump (4.81 KB, application/octet-stream)
2012-09-10 18:29 UTC, valar
Details
Valgrind log (27.17 KB, application/octet-stream)
2012-09-10 18:30 UTC, valar
Details
Rebuilding thumbnails after upgrade 2.5->3.0.0b (git) (465.94 KB, image/png)
2012-09-16 09:00 UTC, valar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description valar 2012-09-06 21:33:48 UTC
There is no good way to deal with sequence number in the rename option.
Camera model used Canon 500D. (tested for both image raw (.CR2) and converted(w/embedded option) (.DNG) files.

Standard camera file name: _IMG4561.CR2 ... _IMG5461.CR2 

(1) It is desired it to preseve the seqence number of the original format, with out the _IMG.
(Request) Perhaps an regexp option/filter on the [file] would be an elegant work around.

(2) Attempts to used EXTIF information failed.
None of these returned any value: (other EXTIF data like Exposure was obtainable)
[meta:Exif.Image.ImageID]
[meta:Exif.Image.ImageNumber]
[meta:Exif.Photo.ImageUniqueID]
[meta:Exif.Canon.FileNumber]
[meta:Exif.CanonFi.FileNumber]

(Request) fix? + 
Believe there ought to exist an additional [meta:Exif.Canon.FileIndex] that is not included
in list (using it did not help, put suppose it is not extracted?).
http://search.cpan.org/~exiftool/Image-ExifTool/lib/Image/ExifTool/TagNames.pod#Canon_CameraInfo500D_Tags

(3) Further more when selecting all photos (800+) and attempting to add METADATA
tags the application/UI "freezed" for ~2 days before recovering operation. 
(Request) Perhaps the update meta tag process ought to be worker thread and abortable.

(4) (Request) It would also be nice to have a undo (rename) + confirm dialog if you just accidently hits enter when working on the renaming options.

Reproducible: Always

Steps to Reproduce:
1. Select 800 photos for rename
2. Used follow advanced rename: [date:"yyyy_MM_dd_T_hh:mm:ss.zzz"]_#_[meta:Exif.Image.ImageID]_[meta:Exif.Image.ImageNumber]

Actual Results:  
When appending meta info the application freezed for 2 days. (no responsive)
Meta tag relating to ID sequenceing returned nothing, the additional # came out as resevere 
order of filename although this seems to be adjustable by correcting sort order prior to rename (not documented)


Expected Results:  
UI update should be a background process and possible abortable if taking to long time.
Some of the tested meta tag ought to return the original image sequence number.

Linux 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux.
--cpuinfo extract: 
model name	: Intel(R) Core(TM)2 CPU         T5600  @ 1.83GHz
bogomips	: 3656.56
---hdparm extract: /dev/sda
ATA device, with non-removable media
	Model Number:       Corsair Force 3 SSD 
---
MemTotal:        3082572 kB
Comment 1 caulier.gilles 2012-09-06 21:44:48 UTC
Can you try with last 2.9.0 release please ?

Gilles Caulier
Comment 2 Andi Clemens 2012-09-08 09:16:36 UTC
(In reply to comment #0)
> There is no good way to deal with sequence number in the rename option.
> Camera model used Canon 500D. (tested for both image raw (.CR2) and
> converted(w/embedded option) (.DNG) files.
> 
> Standard camera file name: _IMG4561.CR2 ... _IMG5461.CR2 
> 
> (1) It is desired it to preseve the seqence number of the original format,
> with out the _IMG.
> (Request) Perhaps an regexp option/filter on the [file] would be an elegant
> work around.


There is a replace modifier, it should work perfectly fine...
Comment 3 valar 2012-09-09 22:21:01 UTC
I suppose the replace modifer is in more recent version then? 

Could only find the 2.5.0 version as deb package (using ubuntu 13 maya)
"The 4-8 hours of compilation time" - build page, 
sounds a bit discouraging but decided to give it a try...

(Note: On http://www.digikam.org/drupal/download?q=download/dependencies
there is a dead link to Kipi-plugins README (https://projects.kde.org/projects/extragear/graphics/kipi-plugins/repository/revisions/master/entry/README) )

I decided to not remove the current digikam version but build the new oneinto /opt if possible.
Most seem fine but missing kipi-plugins accoridng to makefile requires 2.0.0 or higher.
the www.kipi-plugins.org seems non existant??

So not quite sure where to obtain it, my version is 
libkipi -  4:4.8.4-0ubuntu0.1   , /usr/lib/pkconfig/libkipi.pc : 1.3.0
Also checked the Philip Johnsson´s PPA as refered to on the digikam build page,
but also that one seem old:
libkipi - libkipi (4:4.8.4d-precise~ppa1  libkipi.pc : 1.6.0

- Could you give me a pointer on where to obtain it?
- Is it a lot of work to compile it, do all plugins need to be rebuildt etc??
- What functionality would I be missing if I went on without it??
Comment 4 Victor Dodon 2012-09-09 23:06:22 UTC
valar, https://projects.kde.org/projects/kde/kdegraphics/libs/libkipi/repository here is the git repo, in the master branch you find libkipi 2.0.0

Victor Dodon.
Comment 5 valar 2012-09-10 18:29:35 UTC
Created attachment 73793 [details]
kcrash dump
Comment 6 valar 2012-09-10 18:30:40 UTC
Created attachment 73794 [details]
Valgrind log
Comment 7 valar 2012-09-10 19:01:57 UTC
Compiled fine, but crashed right after the splash screen :(
seemed to be something with the Kipi pluging loader/libkdeui?
   // First we remove all plugins from the gui
...
   d->app->guiFactory()->removeClient(plugin);   -- kipipluginloader.cpp:259
Seems to be some related invalid reads from valgrind..

See attachments.

digikam version:
commit d3720c7e04cd53940b9348d582ae95705f098a62
Author: GC
Date:   Thu Aug 23 10:41:40 2012 +0200

libkipi:
commit 8af776df68f54d73f9dd895804e6c2307c3bcc4a
Author: Script Kiddy 
Date:   Mon Sep 10 10:35:15 2012 +0200
Comment 8 Marcel Wiesweg 2012-09-10 19:35:41 UTC
You need to remove all old kipi plugins.
(we have a binary incompatible change with libkipi. There is code which tries to avoid loading kipi plugins depending on the old library, and it is written as I would expect it to work, I checked all that as I got the same crash, but it fails to avoid the crash, I dont know why)
Comment 9 Andi Clemens 2012-09-10 19:54:53 UTC
(In reply to comment #3)
> I suppose the replace modifer is in more recent version then? 

The replace modifier was added in November 2009, this is way before 2.5.0.
2.5.0 was released on Jan 2012... so it should be included in your digiKam installation.
Comment 10 valar 2012-09-10 20:08:22 UTC
Got it working, after removing the digikam and libkipi... 
Rebuilding thumbnails for my albums in hope this will get me something to work with...
will keep you posted...
Comment 11 valar 2012-09-10 20:45:11 UTC
My album folders appear empty, thought rebuilding thumbnails would resolve it!?
Is there some easy way to fix this or does it all have to be reimported??

Would also been nice with some scan/detection of new files in album (not yet indexed in db).
Comment 12 valar 2012-09-16 09:00:41 UTC
Created attachment 73956 [details]
Rebuilding thumbnails after upgrade 2.5->3.0.0b (git)

Added an attachment of the rebuilding of thumbnails.
As seen the thumbnails appears in the rebuild dialog but album
still remains empty. :( 
Would suppose that one should be able to upgrade digikam
version without loosing all the albums.
Comment 13 valar 2012-09-21 23:12:24 UTC
For some reason it seems to work now.
Rebuilt libkipi, kipi-plugins from new git update.
also it seemed important that digikam was installed into same location
as kipi library or /usr rather than /opt as I had done initially.
Perhaps could have been solved by some update to ld.so.conf..

The replace worked nicely:
[date:"yyyy_MM_dd_T_hh:mm:ss"]_IN_[file]{replace:"_MG_","",i}

Will give feedback on the other issues another day as it suddenly :) got late.
Comment 14 valar 2012-09-22 13:48:58 UTC
In summary:

Issue 1: resolved.
The replace work. Although not so easy to find. Probably fixed in earlier version as mentioned
and not an issue at all.

Issue 2: still open
EXTIF did not return any information on the cannon raw files (.CR2 - camera 500D)
[meta:Exif.Image.ImageID] [meta:Exif.Image.ImageNumber] [meta:Exif.Photo.ImageUniqueID] [meta:Exif.Canon.FileNumber] [meta:Exif.CanonFi.FileNumber] 

Issue 2b (feature request) : open
[meta:Exif.Canon.FileIndex]  is missing accoridng to:
 http://search.cpan.org/~exiftool/Image-ExifTool/lib/Image/ExifTool/TagNames.pod#Canon_CameraInfo500D_Tags

Issue 3: seems resolved. The load icon is displayed for a periode of times but does 
not go on forever... 

Else it seems the kipi plugins did not load ?! tried adding the /usr/lib/kde4 to /etc/ld.so.conf
but did not work. Not sure if there is some conditions on version number when loading 
it and the git version simply is to new... any hints would be appreciated..
Comment 15 caulier.gilles 2012-09-22 14:31:27 UTC
digiKam SC do not use ExifTool, but Exiv2 shared library. 

http://www.exiv2.org/

The issue 2a :

I don't understand exactly. Are you suer to use right Exif tags, managed by Exiv2 ?

http://www.exiv2.org/tags.html

Are you sure that your image include these tags ?

The issue 2b : 

Accordingly with tags list supported by Exiv2 :

http://www.exiv2.org/tags-canon.html

Exif.Canon.FileIndex is not registered... This must be reported to Exiv2 bugzilla.
Comment 16 valar 2012-09-22 19:44:41 UTC
Will see if I can verify the extif information with some 3rd party application.

Figured out that the kipi-plugins did not load because a version mismatch:
"KIPI::PluginLoader::init: Plugin  "<plugin>" has a SO version" "which is different than libkipi ABI version"
Both where buildt from master git repository.

Probably not a good workaround but resolved it by
chaning the SET(KIPI_LIB_SO_CUR_VERSION "10") to 0 in the CMakeLists.txt 
for the libkipi and rebuildt it. And a symbolic link in the lib directory.

All plugins except following seems to load fine:
digikam(29087)/KIPI (loading) KIPI::PluginLoader::Info::plugin: Cannot create instance for plugin  "iPodExport"  ( "kipiplugin_ipodexport" )  with error:  "Could not find plugin 'iPodExport' for application 'digikam'" 
digikam(29087)/KIPI (loading) KIPI::PluginLoader::Info::plugin: Cannot create instance for plugin  "Shwup Export"  ( "kipiplugin_shwup" )  with error:  "Could not find plugin 'Shwup Export' for application 'digikam'" 
digikam(29087)/KIPI (loading) KIPI::PluginLoader::Info::plugin: Cannot create instance for plugin  "Yandex.Fotki Exporter"  ( "kipiplugin_yandexfotki" )  with error:  "Could not find plugin 'Yandex.Fotki Exporter' for application 'digikam'" 
digikam(29087)/KIPI (loading) KIPI::PluginLoader::Info::plugin: Cannot create instance for plugin  "HTML Gallery"  ( "kipiplugin_htmlexport" )  with error:  "Could not find plugin 'HTML Gallery' for application 'digikam'"

Worse is perhaps this?!?: 
digikam(29087)/digikam (core) Digikam::DatabaseCoreBackendPrivate::debugOutputFailedQuery: Failure executing query:
 "INSERT INTO Tags (pid, name) VALUES( ?, ?);" 
Error messages: "Unable to fetch row" "columns id, pid are not unique" 19 1 

Haven't added any tags (only see this My Tag) so not sure if it is a upgrade issue or something.
Comment 17 valar 2012-09-22 20:41:59 UTC
The Tags table is empty but the tagstree has 23 entries? suppose it is the 
insert trigger that fails (19,1 already exist) .

Thining of backing up the .db file and attempt deleting the tagtree table?? 
Alternatively rename it and relaunch digikam and reimport the album folder (maintance mode)
Any advices here?

CREATE TABLE Tags
                            (id INTEGER PRIMARY KEY,
                            pid INTEGER,
                            name TEXT NOT NULL,
                            icon INTEGER,
                            iconkde TEXT,
                            UNIQUE (name, pid));
...
CREATE TRIGGER insert_tagstree AFTER INSERT ON Tags
                BEGIN
                INSERT INTO TagsTree
                    SELECT NEW.id, NEW.pid
                    UNION
                    SELECT NEW.id, pid FROM TagsTree WHERE id=NEW.pid;
                END;
Comment 18 valar 2012-09-22 20:47:10 UTC
My guess is that this state was introduced by running the face detection stuff from the maintainance tool (when no tags existed??)

Or possibly an upgrade issue from 2.5 but I never got around to add tags there either.
Comment 19 Marcel Wiesweg 2012-09-23 13:29:15 UTC
The db error is usually not serious, it means a tag being added  had alreadybeen added.

Please avoid mixing so many issues in one report. I dont know at all what is the problem at hand. It seems there's a problem with some Exif fields. Which one? Are they not being read, in which context? Sample file to test?
Comment 20 valar 2012-09-23 20:04:51 UTC
Due to the database inconsitency no more tags could be added.
Not manually nor automatic by the face detection tool.

However deleting the tagtree table resolved the issue for me.
For those that stil have entries in the tag table better would probably be to
do a selected delete aka:  delete from tagstree where id not in ( select id from tags);

Not sure why the inconsitency occured,  would think the delete trigger 
should have cleaned this up, but perhaps they did not exist in 2.5.0 version? 

Do not plan to spend more time on the extif issue, also it is a third party
library so does not really belong here.

Setting this to resolved.
Thanks for the help and support.