メインコンテンツへスキップ

⚠️ Please note that this topic or post has been archived. The information contained here may no longer be accurate or up-to-date. ⚠️

Avoid duplicates at import (catalog)

コメント

12件のコメント

  • Permanently deleted user
    I don't believe you're missing anything - unfortunately, C1 allows duplicates on import.

    I too would like Phase One to include this filter in their product, but the issue has been raised before on this forum with people either very much in favour or highly indifferent!

    Regards
    0
  • NN635652537892597270UL
    Maybe that's because a lot of people are using sessions.
    Duplicates are a nightmare with catalogs.
    0
  • Eric Nepean
    [quote="Romain7" wrote:
    Maybe that's because a lot of people are using sessions.
    Duplicates are a nightmare with catalogs.

    Suppose you had a script that would report the name and location of all the duplicates of an image in an album or project. Would that be useful?
    0
  • Permanently deleted user
    [quote="Eric Nepean" wrote:
    [quote="Romain7" wrote:
    Maybe that's because a lot of people are using sessions.
    Duplicates are a nightmare with catalogs.

    Suppose you had a script that would report the name and location of all the duplicates of an image in an album or project. Would that be useful?


    Sounds useful, Eric.
    0
  • Eric Nepean
    [quote="ShaneB" wrote:
    [quote="Eric Nepean" wrote:

    Suppose you had a script that would report the name and location of all the duplicates of an image in an album or project. Would that be useful?

    Sounds useful, Eric.

    So what do we compare to determine a duplicate? (and lets make it as simple as possible)
    Is it that the filename is the same?
    Is the folder location the same?
    Does the date and time stamp need to be compared?
    0
  • Eric Nepean
    I think I now understand the situation (correct me if not)

    What imay be your situation is that you are pulling images off a flash memory card using Capture One, and storing them as referenced images or managed images in a Capture One catalog.

    If the images are not deleted from the flash card after import, then they will still be present at a future import, and can be imported again, but with a different name.

    (When I do a test duplicate import of a referenced image already in my catalog - from the file and folder where it is stored - Capture One notices and it is as if the import never happened)

    Are you storing the images imported from flash as managed images or referenced images?

    I think the only possible comparison to identify duplicatess is to compare image creation dates and times, and check they are from the same camera in the same format.
    0
  • Permanently deleted user
    [quote="Eric Nepean" wrote:
    I think I now understand the situation (correct me if not)

    ...

    I think the only possible comparison to identify duplicatess is to compare image creation dates and times, and check they are from the same camera in the same format.


    For me, at least, I have problems with duplicates arising from two different causes:
    - downloading files from the same media twice, and
    - as a result of duplicate files on my computer arising from the bad old days of using PhotoShop as my main editor.

    The latter is down to my own poor management, but downloading images from a card twice is a pain I'd hope C1 (or a script) could deal with. On that basis, scanning for identical file name, date and time would cover my needs.

    Regards
    0
  • Eric Nepean
    [quote="ShaneB" wrote:

    For me, at least, I have problems with duplicates arising from two different causes:
    .......
    - as a result of duplicate files on my computer arising from the bad old days of using PhotoShop as my main editor.

    Hi Shane, do you generally import the images into C1 as referenced (leave in place) or managed (move into catalog)?
    0
  • NN635652537892597270UL
    I do import as managed files.
    That's problem happens. And there is no way to detect the copies after import either.
    0
  • Permanently deleted user
    [quote="Eric Nepean" wrote:
    [quote="ShaneB" wrote:

    For me, at least, I have problems with duplicates arising from two different causes:
    .......
    - as a result of duplicate files on my computer arising from the bad old days of using PhotoShop as my main editor.

    Hi Shane, do you generally import the images into C1 as referenced (leave in place) or managed (move into catalog)?


    I do both, depending on the circumstances.

    Regards
    0
  • Mike Conley
    I'm fairly certain I've filed a feature request for this very problem. I always import multiple times from the same card, as new images are recorded onto it (I leave them in place as a short-term backup, just in case). Aperture was lovely in this regard, as it obviously retained the full path to the image on the mounted device and would allow you to prevent duplicate downloads.

    Trying to detect duplicates based on other criteria might work, I suppose. I would use initial matching substrings from the image name (as if the names do differ, they are likely only to differ due to the addition of a suffix), and the timestamp in the EXIF on the original image, which should always be identical.
    0
  • Eric Nepean
    Here is an Applescript that searches the All Images collection for duplicates.
    Select all, copy and paste into a blank script editor document.
    Open the log history window, that where the output comes.
    Then compile and run.

    It's not particularly fast, but you won't have to run it often.



    global date_list, list_begin, list_length, list_end, up_pointer_list, down_pointer_list, start_pointer_up, start_pointer_down, image_date, image_index, debug, image_count, dupe_image_list, name_list

    set debug to 1

    tell application "Capture One 10"
    set date_list to EXIF capture date of every image
    set name_list to name of every image
    end tell
    set image_count to count of date_list

    sort_date_list()

    pointer_check()

    if debug ≥ 1 then log "Initialising Dupe Search"
    set list_length to image_count
    set next_pointer to start_pointer_up
    set next_date to item next_pointer of date_list
    set dupe_found to false
    set first_date to 0
    set dupe_image_list to {}
    repeat with counter from 1 to list_length - 1
    set prev_date to next_date
    set prev_pointer to next_pointer
    set next_pointer to item next_pointer of up_pointer_list
    set next_date to item next_pointer of date_list
    if next_date = prev_date then
    if dupe_found = false then -- start of a series of duplicates - found two
    if debug ≥ 3 then log "Found Dupe"
    set dupe_found to true
    set first_date to prev_date
    add_to_dupe_list(item prev_pointer of name_list)
    add_to_dupe_list(item next_pointer of name_list)
    else -- adding another duplicates
    add_to_dupe_list(item next_pointer of name_list)
    end if
    else if dupe_found = true then -- end of a series of duplicates
    if debug ≥ 4 then log dupe_image_list
    evaluate_display_dupe_list()
    set dupe_found to false
    set dupe_image_list to {}
    set first_date to 0
    end if
    end repeat

    ################# Handlers

    on add_to_dupe_list(image_name)
    global debug, dupe_image_list, name_list
    --set image_name to item image_index of name_list
    set image_type to text ((offset of "." in image_name) - (length of image_name)) thru -1 of image_name -- extract image type
    if (count of dupe_image_list) = 0 then -- if the list is empty
    set end of dupe_image_list to {image_type} -- add image type to the list
    set sublist_index to 1
    else -- is the image type in the list
    set type_found to false
    repeat with sublist_index from 1 to count of dupe_image_list
    if item 1 of item sublist_index of dupe_image_list = image_type then
    set type_found to true
    exit repeat
    end if
    end repeat
    if not type_found then --else add image type to the list
    set end of dupe_image_list to {image_type}
    set sublist_index to count of dupe_image_list
    end if
    end if
    set end of item sublist_index of dupe_image_list to image_name --add image name to the sublist
    end add_to_dupe_list


    on evaluate_display_dupe_list()
    global debug, dupe_image_list
    if debug ≥ 4 then log dupe_image_list

    repeat with sublist_index from 1 to count of dupe_image_list --For each sublist

    if (count of item sublist_index of dupe_image_list) > 2 then -- if there is more than one image name then determine if this could be a burst
    --log (item sublist_index of dupe_image_list)
    set is_burst to true
    set image_seq_list to {}
    repeat with sublist_counter from 2 to count of item sublist_index of dupe_image_list -- the first entry in the sublist is the extension
    set image_name_ext to item sublist_counter of item sublist_index of dupe_image_list
    set image_name to (text 1 thru ((offset of "." in image_name_ext) - 1) of image_name_ext)

    set image_name_s to quoted form of image_name
    do shell script "sed s/[^0-9]//g <<< " & image_name_s
    set image_num_list to the result
    if (count of image_num_list) = 0 then -- if there are no numbers in the image name, this is not a burst
    set is_burst to false
    exit repeat
    else
    set image_num to image_num_list as integer
    set end of image_seq_list to image_num
    end if

    do shell script "sed s/[0-9]//g <<< " & image_name_s
    set image_char_list to the result

    if sublist_counter = 2 then
    if (count of image_char_list) > 0 then
    set has_image_char to true
    set image_char_ref to image_char_list
    else
    set has_image_char to false
    end if

    set image_seq_min to image_num

    else -- sublist counter >2

    if has_image_char then -- check that the image characters match the first image
    if image_char_list ≠ image_char_ref then
    set is_burst to false
    exit repeat
    end if
    else -- first image name has no characters
    if (count of image_char_list) > 0 then
    set is_burst to false
    exit repeat
    end if
    end if

    if image_num < image_seq_min then set image_seq_min to image_num -- find the starting sequence number
    end if
    if debug ≥ 4 then log image_num
    if debug ≥ 4 then log image_char_list
    end repeat

    if is_burst then -- check that the image numbers are sequential with increments of 1

    set image_seq_count to count of image_seq_list
    set image_sorted_seq_list to {image_seq_min}

    repeat with incr_counter from 2 to count of image_seq_count
    set seq_found to false
    set last_seq to end of image_sorted_seq_list
    repeat with seq_counter from 1 to image_seq_count
    if item seq_counter of image_seq_list = last_seq + 1 then
    set end of image_sorted_seq_list to (item seq_counter of image_seq_list)
    set seq_found to true
    exit repeat
    end if
    end repeat
    if seq_found = false then
    set is_burst to false
    exit repeat
    end if
    end repeat
    end if

    if not is_burst then
    log (items 2 through (count of item sublist_index of dupe_image_list) of item sublist_index of dupe_image_list)
    end if
    end if
    end repeat
    end evaluate_display_dupe_list

    on sort_date_list()
    global date_list, list_begin, list_length, list_end, up_pointer_list, down_pointer_list, start_pointer_up, start_pointer_down, image_date, image_index, debug, image_count

    set list_end to image_count + 1
    set list_begin to 0 as integer

    set list_length to 1 as integer
    set start_pointer_up to list_begin + 1
    set start_pointer_down to list_begin + 1
    set up_pointer_list to {list_end}
    set down_pointer_list to {list_begin}
    set image_index to 0

    if debug ≥ 1 then
    log {"Up Pointer List", start_pointer_up, "--", up_pointer_list}
    log {"Down Pointer List", start_pointer_down, "--", down_pointer_list}
    log (items 1 thru 2 of date_list)
    log {"Starting List", (items 1 thru list_length of date_list)}
    end if

    repeat while image_index < image_count
    set image_index to list_length + 1
    set image_date to item image_index of date_list
    if debug ≥ 2 then log {"Start Image ", image_index, image_date}

    set compare_index to image_index - 1
    set compare_date to item compare_index of date_list

    if image_date < compare_date then
    search_down(compare_index, compare_date)
    else
    search_up(compare_index, compare_date)
    end if
    if debug ≥ 2 then
    log {"Done", "up:", start_pointer_up, "-", up_pointer_list, "down:", start_pointer_down, "-", down_pointer_list}
    log " "
    end if
    if image_index > 10 and debug ≥ 4 then exit repeat
    end repeat
    end sort_date_list

    on search_up(prev_candidate_image_index, prev_candidate_image_date)
    global date_list, list_begin, list_length, list_end, up_pointer_list, down_pointer_list, start_pointer_up, start_pointer_down, image_date, image_index, debug
    if debug ≥ 3 then log {"Search_Up", prev_candidate_image_index, prev_candidate_image_date}
    set found to false
    repeat while not found
    set next_candidate_image_index to item prev_candidate_image_index of up_pointer_list
    if next_candidate_image_index = list_end then -- we have reached the end of the list
    if debug ≥ 3 then log "reached the start of the list"
    insert_image_at(next_candidate_image_index, prev_candidate_image_index) --insert the new item at the list end
    set found to true
    else --search for the first image which is newer than this image
    set next_candidate_image_date to item next_candidate_image_index of date_list
    if image_date > next_candidate_image_date then --search further up
    set prev_candidate_image_index to next_candidate_image_index
    else
    insert_image_at(next_candidate_image_index, prev_candidate_image_index)
    set found to true
    end if
    end if
    end repeat
    end search_up

    on search_down(prev_candidate_image_index, prev_candidate_image_date)
    global date_list, list_begin, list_length, list_end, up_pointer_list, down_pointer_list, start_pointer_up, start_pointer_down, image_date, image_index, debug
    if debug ≥ 3 then log {"Search_Down", prev_candidate_image_index, prev_candidate_image_date}
    set found to false
    repeat while not found
    set next_candidate_image_index to item prev_candidate_image_index of down_pointer_list
    if next_candidate_image_index = list_begin then --we have reached the start of the list
    if debug ≥ 3 then log "reached the start of the list"
    insert_image_at(prev_candidate_image_index, next_candidate_image_index) --insert the new item at the list start
    set found to true
    else --search for the first image which is older than this image
    set next_candidate_image_date to item next_candidate_image_index of date_list
    if image_date < next_candidate_image_date then -- search further down
    set prev_candidate_image_index to next_candidate_image_index
    else
    insert_image_at(prev_candidate_image_index, next_candidate_image_index)
    set found to true
    end if
    end if
    end repeat
    end search_down

    on insert_image_at(higher_image_index, lower_image_index)
    global date_list, list_begin, list_length, list_end, up_pointer_list, down_pointer_list, start_pointer_up, start_pointer_down, image_date, image_index, debug
    if debug ≥ 3 then log {"Insertion", higher_image_index, lower_image_index}
    set end of up_pointer_list to higher_image_index
    set end of down_pointer_list to lower_image_index

    if higher_image_index = list_end then
    if debug ≥ 3 then log {"End Insertion"}
    set start_pointer_down to image_index
    else
    set item higher_image_index of down_pointer_list to image_index
    end if

    if lower_image_index = list_begin then
    set start_pointer_up to image_index
    if debug ≥ 3 then log {"Begin Insertion"}
    else
    set item lower_image_index of up_pointer_list to image_index
    end if

    set list_length to list_length + 1
    end insert_image_at

    on pointer_check()
    global date_list, list_begin, list_length, list_end, up_pointer_list, down_pointer_list, start_pointer_up, start_pointer_down, image_date, image_index, debug

    if debug ≥ 4 then
    log (items 1 thru list_length of date_list)
    set next_pointer to start_pointer_up
    set sorted_date_list to {item next_pointer of date_list}
    set sorted_image_list to {next_pointer}

    repeat with counter from 1 to list_length - 1
    set next_pointer to item next_pointer of up_pointer_list
    set end of sorted_date_list to item next_pointer of date_list
    set end of sorted_image_list to next_pointer
    end repeat
    log sorted_date_list
    log sorted_image_list

    set next_pointer to start_pointer_down
    set sorted_date_list to {item next_pointer of date_list}
    set sorted_image_list to {next_pointer}
    repeat with counter from 1 to list_length - 1
    set next_pointer to item next_pointer of down_pointer_list
    set end of sorted_date_list to item next_pointer of date_list
    set end of sorted_image_list to next_pointer
    end repeat
    log sorted_date_list
    log sorted_image_list

    end if

    if debug ≥ 1 then
    set next_pointer to start_pointer_up
    set this_date to item next_pointer of date_list
    set list_good to true
    repeat with counter from 1 to list_length - 1
    set prev_date to this_date
    set prev_pointer to next_pointer
    set next_pointer to item next_pointer of up_pointer_list
    set this_date to item next_pointer of date_list
    if this_date < prev_date then
    set list_good to false
    log {"Up pointer error between items ", next_pointer, this_date, "and", prev_pointer, prev_date}
    end if
    end repeat

    if item next_pointer of up_pointer_list ≠ list_end then
    log {"error in last up pointer", next_pointer, (item next_pointer of up_pointer_list)}
    end if

    if list_good = true then log "Up Pointers are OK"

    set next_pointer to start_pointer_down
    set this_date to item next_pointer of date_list
    set list_good to true
    repeat with counter from 1 to list_length - 1
    set prev_date to this_date
    set prev_pointer to next_pointer
    set next_pointer to item next_pointer of down_pointer_list
    set this_date to item next_pointer of date_list
    if this_date > prev_date then
    set list_good to false
    log {"Down pointer error between items ", next_pointer, this_date, "and", prev_pointer, prev_date}
    end if
    end repeat

    if item next_pointer of down_pointer_list ≠ list_begin then
    log {"error in last down pointer", next_pointer, (item next_pointer of down_pointer_list)}
    end if

    if list_good = true then log "Down Pointers are OK"

    end if

    end pointer_check


    0

投稿コメントは受け付けていません。