[Digikam-devel] [Bug 293832] Digitaglinktree - Multi tag level combination - find any image though directory browsing [patch]
cyril.raphanel at gmail.com
cyril.raphanel at gmail.com
Thu Feb 16 18:39:54 GMT 2012
https://bugs.kde.org/show_bug.cgi?id=293832
--- Comment #20 from <cyril raphanel gmail com> 2012-02-16 18:39:54 ---
I need help
I call the function by
# Manage tags
createLinkTreeMultiBranch($refImages->{$i},${linktreeRootDir},$photoRootDir,0);
sub createLinkTreeMultiBranch{
my(@tag_list,$linktreeRootDir,$photoRootDir,$counttag)=@_;
$path=$tag_list->{"path"};
$image=$tag_list->{"image"};
$imgid=$tag_list->{"imgid"};
$imgYear=$tag_list->{"imgYear"};
$counttag++;
$toto=$tag_list->{"tagpath"};
print "IMAGEID - $tag_list - $path - $image - $imgid - $imgYear\n";
for( $j=0; $j<=$#{${tag_list}->{"tag"}}; $j++){
$tag=$tag_list->{"tagpath"}->[$j];
print "NB -- COUNTTAG -- $counttag -- TAG -- $tag\n";
# Check if we have not tried the path before
if(${linktreeRootDir} !~ /($tag)/) {
# print "$item -- $image --$item/$tag $tagcount $j\n";
# Create subdirectories needed
if( ! -d "${linktreeRootDir}/$tag/_all" ){
$ret=mkpath("${linktreeRootDir}/$tag/_all", 0, 0755);
if( !$ret ){
die "Cannot mkdir \"${linktreeRootDir}/$tag/_all\"\n";
}
}
# Avoid conflicts for images with the same name in one tag
directory
$linkName=$imgid."_".$image;
# Get relative path from absolute one
$relPath="";
$relPath=File::Spec->abs2rel("${photoRootDir}$path",
"${linktreeRootDir}/$tag/_all" ) ;
if( !length($relPath)){
die "Cannot create relative path from
\"${linktreeRootDir}/$tag/_all\" to \"${photoRootDir}$path\" . Abort.\n";
}
# Create link
$sourceDir="$relPath/$image";
$destDir="${linktreeRootDir}/$tag/_all/$linkName";
if (!-e $destDir){
$ret=symlink($sourceDir, $destDir);
if( !$ret ){
$ret="$!";
warn "Warning: Failed symbolic linking \"$sourceDir\"
to \"$destDir\": ",
"\"$ret\"\n";
}
}
if ($counttag < $#{$refImages->{$i}->{"tag"}}){
# create subdir
createLinkTreeMultiBranch(\%refImages,${linktreeRootDir}/$tag,$photoRootDir,$counttag);
}
}
}
}
I get
IMAGEID - HASH(0xaa06d0c) - - - -
--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Digikam-devel
mailing list