Announcement

  •  » Requests
  •  » Request: Omit Directories When Importing Photos via Import Tree Script

#1 2013-01-17 03:03:33

kenl
Member
2013-01-12
91

Request: Omit Directories When Importing Photos via Import Tree Script

I use Google Picasa to organize my photos.  When editing a photo, in Picasa, a directory called .picasaoriginals is created.  This directory holds earlier versions of the edited photos.

When I used import_tree to populate my piwigo installation, the script saw the .picasaoriginals directories and inserted them into piwigo.  I did not want this to happen.

So, my request is a parameter that allows import_tree to ignore certain directory names.  Either a --omit paramter that specifies directory names or perhaps specifies a file name where the file contains the names of directories to omit.

In my case I manually edited the perl script and omitted any directory with .picasaoriginals in the name.  But, I know next to nothing about perl and would never submit my hacked up version.

Ken

Offline

 

#2 2013-01-17 04:38:07

pewe
Member
2012-03-16
439

Re: Request: Omit Directories When Importing Photos via Import Tree Script

Why not post your 'hack' and maybe someone who knows perl well could comment ;)

Offline

 

#3 2013-01-17 16:41:08

kenl
Member
2013-01-12
91

Re: Request: Omit Directories When Importing Photos via Import Tree Script

Unfortunately, my solution is specific to skipping just the .picasaoriginals directory.  A more generic solution, where perhaps multiple directory names could be skipped, would be preferable.  Also, the directory name(s) should be specified as an input parameter, rather than hard-coded.  But, anyway here's what I did:

In the function add_to_piwigo -

I changed:
     if (not defined $piwigo_albums{$up_dir.$dir}) {

to:
     if ((not defined $piwigo_albums{$up_dir.$dir}) && (not ($dir =~ m/.picasaoriginals/)))     {

and I changed:
     if (-f and $path =~ /\.(jpe?g|gif|png)$/i) {

to:
     if ((-f and $path =~ /\.(jpe?g|gif|png)$/i ) && (not ($path =~ m/.picasaoriginals/))) {

Ken

Offline

 
  •  » Requests
  •  » Request: Omit Directories When Importing Photos via Import Tree Script

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact