Reordering images files in Tropy

I have imported images but a few are out of order. How can I move or reorder, that is place them in the correct order. When I try to drag them to the correct order the images are merged. Is there functionality for reordering images after they have been moved into Tropy?

The order of items in the project view depends on the active sort column. This is currently not obvious if you’re in the grid view (we’re planning to improve that) so for the sake of this, please make sure you’re in the ‘table’ view (i.e., zoomed out all the way).

To change the sort order, click on any of the columns to sort by that column (and repeatedly to toggle between ascending and descending). You can add or remove columns by right clicking on the column header; you can also drag around columns if you would like to change their order. Please note that there isn’t really one ‘natural’ order to items in Tropy; if you would like to see them in the order in which you originally imported the items you can sort by the ‘Date Added’ column.

In lists, there is a special ‘position’ column; currently this is the order in which you added items to that list. We’ll be looking to add support for dragging items around (in lists only) to change that order to allow you to create lists of items in an arbitrary order (right now this is possible if you add items to the list in the correct order, but dragging items around will make it much easier in the future).

Finally, please note that at the moment all values are treated as text; especially numerical data may not always be sorted as expected. That’s something that will be improved as we add dedicated value data types.

So, sorting by “Date added” doesn’t really help. For instance, I just dragged 32 jpegs over and they all have the same time stamp: Oct 23, 2018 4:38pm. They start off alright since the title defaults to the file name, but as I go through and retitle them, then that obviously no longer works.

Since the file name is already captured in the metadata, it seems like allowing us to select to view that information and therefore sort by it would allow for at least sequentially taken taken (and named) photos to be kept in order.

I’m not sure I follow? You can sort by title by clicking on the title column.

Yes, but as I process documents I am changing the titles. I don’t want to sort by title- I want to sort by jpeg file name b/c as I change the titles the items automatically rearrange.

For example, let’s say I have IMG_001 through IMG_299. Tropy automatically titles each image with the file name. If I want to view these in the order that I photographed them (which is essential in order to merge when necessary), then I need to sort by title. BUT, now I start processing items. I retitle IMG_002 so that it is called “Secret Memo 46”. And now it immediately drops to the bottom of the list. And then I go out to the list and retitle IMG_003 so that it is called “Editorial Memo 42”. This item now goes to the top of the list. It’s sloppy and frustrating as I have to keep scrolling to the middle of item list in order to process the next item.

Sorting by title would be fine if I never need to change the titles…

Thanks, now I see what you mean. Sorting by file name is a little tricky, because we’re sorting items in the project view, not the photos. As long as you have one photo per item there is an obvious relationship to a filename, but not if you have multiple photos per item (or no photo at all).

To recall the order in which items were created, ‘Date Added’ really seems like the best choice to me. I’ll have to check why we don’t save that time at millisecond precision – that might fix the problem.

In the meantime, one thing you could do to preserve the sort order of the originally assigned titles is to sort by title immediately after import, select the whole batch of photos and add them to a list: the list should keep the order in which items were added to it in the position column.

Alas, I have already tried sorting by title initially and creating a list, but it doesn’t preserve the order (I have one that I call “Processing” so that I can keep contained exactly what I’m working on since some files I document in the archives are 200+ images that need to be clustered, titled, etc).

I do also see what you mean regarding the sorting by file name being a tricky issue once you start merging multiple files into a single Tropy item. As a thought, since most of the time we’re photographing document pages sequentially, is it possible to have the file name field only list the FIRST (alphabetically) file name in an item?

For instance, items that consist of only one file would default to that the only file name associated w that item. But, if an item consists of 30 consecutive jpegs, say, IMG_021 through IMG_050, then it would list IMG_021 in that field.

Item# | Title | FirstFile
1 | memo 62 | IMG_001
2 | memo 128 | IMG_002
3 | Letter to the Editor | IMG_009
4 | Secret Telegram 102 | IMG_021
5 | Annual Report 1943 | IMG_050

Sorry, I should have explained that in more detail. When adding multiple items to a list with one action, the order is determined by your selection (this gives you lots of flexibility, because you can select items in an arbitrary order). If you want to preserve the order as currently displayed (e.g., sorted by the default title) the quickest way to do it is:

  1. Select the first item (i.e. topmost in the view)
  2. Hold the shift key and select the last item of your set
  3. Drag the first item (the one you selected in step 1) to your list

This should add the items to your list in the order you currently see them on the screen.

I checked and we do, indeed, save Date Added with second precision (not milliseconds); however, when sorting by date added, we use Tropy’s internal id as the secondary sort column; this id is assigned sequentially, so that means sorting by date added will always give you exactly the order in which the items were added. This does not necessarily mean alphabetical order of the file names you imported, because this really depends on the order reported to Tropy by the operating system… so, you’re right to note that date added may not be that helpful when you have an explicit ‘natural’ order in mind (such as order by original filename).

We already use the thumbnail of an items first photo (you can control the order of the photos in an item) so it would actually be straight forward to use that filename and display it in a special column. It might be harder to use that for sorting though… but we’ll consider it. It would certainly be helpful in this case!

Ah, I see what you mean. I’ll try to do it that way, but it does seem a little precarious because the moment you sort by something else (even by accident) then the numbers reassign and you’ve lost the original order you brought into the list. There doesn’t seem to be (as far as I can tell), a way to really make that order fixed (at least not the same way you can with images that have been merged into a single document)

And it makes perfect sense really that the order added, even if done on a more granular level, isn’t the way to go b/c that’s just now how the OS is thinking about things.

This kind of sorting can be more useful than you might realize. As an example, when merging items, sometimes it isn’t easy determine whether two sequential pages should go together (this is esp the case in governmental records where a memo may have several attachments. Perhaps you cluster 8 images together, and it is only when going back and transcribing the memo you realize that what looked like a separate memo is actually, rather, an addendum w/in the memo- and it is important for you to be able to preserve these together. But by now you’ve lost that original order so you have the joy of checking each item from that archive file and figure out which item this image should have been attached to…

On a related note, the image previews are always centered- which means that usually the headings are cut off, which in turn makes it harder to determine whether to merge items together- especially when page after page of block text and only the top three lines indicate whether it is a new item or continuation of the last one. Is there a way to adjust that? Otherwise I have to keep navigating into an item and back out again

The order in lists is preserved. If you select a list you get an extra ‘position’ column; the column does not have a label (because of space concerns) but you can click on it to make it the active sort column. You can pick a different sort order for each list, but you can always go back to the list’s inherent order by clicking on the position column. (Like I mentioned, the list’s position will become way more useful once we’ve implemented drag and drop of items within the list.)

Preserving the thumbnails’ dimensions is something we’re considering (but it’s not imminent). We could add a preference to crop the photos differently though. I’ll open an issue to track this on GitHub.

1 Like

I’m still having issues with the order in the list. I’ve tried a couple of times and regardless of how I select and drag the items into a fresh list, the order preserved is not however they were ordered when I selected them.

Just popping on with another use case in which the utility of being able to order images by order taken (or file name) would be hugely useful:
I’m processing a lot of correspondence at the moment and at times the order in the file is the only way to work out certain details. Some letters are missing dates entirely, so I can only know what they are responding to by placement in the file (obviously when all dates are present then I can order them by date). Many also are only addressed to “Sir” or “Madam”, and the only way of knowing who it is addressing is to look at it the letter it is responding to.

My work around at the moment is to have a separate list for each archival box, but that is not sustainable in the long run.

Anyway, I know it’s something without an easy fix (per our previous exchanges), but wanted to add this additional feedback as I imagine this sort of case with correspondence is one many historians will have to deal with if they use Tropy

As I get everything reinstalled on the new computer, I have another reordering dilemma.

In Windows, it is fairly easy to automatically number a series of files with a base name, and then Windows will automatically number them. This produces a series of files that might be called:
cwgc_file26 (1).jpeg
cwgc_file26 (2).jpeg
cwgc_file26 (3).jpeg

cwgc_file26 (10).jpeg
cwgc_file26 (11).jpeg
cwgc_file26 (12).jpeg
and so on…

However, when ordering by file name, Tropy seems to follow a different convention than windows uses. My 32 image file right now gets ordered as follows:
cwgc_file26 (1).jpeg
cwgc_file26 (10).jpeg
cwgc_file26 (11).jpeg
cwgc_file26 (12).jpeg

cwgc_file26 (19).jpeg
cwgc_file26 (2).jpeg
cwgc_file26 (20).jpeg
cwgc_file26 (21).jpeg

cwgc_file26 (29).jpeg
cwgc_file26 (3).jpeg
cwgc_file26 (30).jpeg
cwgc_file26 (31).jpeg

Naturally, this is QUITE out of order and gets even trickier when bringing in a 200 image file at once. I dont know of a way to change the naming convention that windows uses, so is there a way to get Tropy to follow the same ordering logic that Windows uses?

Yes, this is an open issue. Tropy currently orders those values compared strictly as text; whereas Windows incorporates the numeric values into the comparison. We think the latter would make sense for Tropy, too, and we’ll be looking to address this (this also relates to ordering e.g., diacritics similar or language-specific rules).

1 Like

Any update on this ordering issue? Reordering manually every time is really time consuming…

I think we finally found the right way to do this and I’m currently working on enabling natural sorting directly in the database. I’ll update this thread when I know which release this will be part of.

1 Like

Just checking back in :slight_smile:

Yes… this has turned into quite a deep rabbit hole. The short answer is, that this isn’t in 1.5 yet, but on our roadmap for 1.6 (i.e., it should be coming in one of the 1.5.x releases), but since you’ve been waiting a long time I was going to experiment with a quick workaround that might just work well enough for most cases (with some potential performance penalties so we may hide this behind a flag initially). I promise another update here within a week!

Hey Guys,

I think, I have the same problem as kutne, so I wanted to ask: is this issue already solved or is there any news concerning this subject?

Thank you so much!