Add --no_error_purge flag to not remove errored images from image list #1

Open
spacelama wants to merge 2 commits from spacelama/qiv:master into master

There are times when you want qiv-command to be able to move a file to
another location and no longer be in the active list of files being
displayed by qiv, but you also want to be able to go back to that file
(a bit like delete/undelete). So qiv's default behaviour of
completely removing the file that fails to load from the list of
images is not quite what you want. Instead, --no_error_purge simply
advances to the next image in response to qiv-command returning and
the file no longer existing, or displays the error page (blank blue
screen) when failing to load the image from scratch.

There are times when you want qiv-command to be able to move a file to another location and no longer be in the active list of files being displayed by qiv, but you also want to be able to go back to that file (a bit like delete/undelete). So qiv's default behaviour of completely removing the file that fails to load from the list of images is not quite what you want. Instead, --no_error_purge simply advances to the next image in response to qiv-command returning and the file no longer existing, or displays the error page (blank blue screen) when failing to load the image from scratch.
ciberandy reviewed 9 months ago
image_idx = 0;
/* If deleting the last file out of x */
if(images == image_idx)
image_idx = 0;
Poster
Owner

This is no real change but just different whitespacing, right?

This is no real change but just different whitespacing, right?
Poster

No, it's indented with the:

if (! keep_error_images) {
No, it's indented with the: if (! keep_error_images) {
ciberandy reviewed 9 months ago
/* If deleting the only file left */
if(!images) {
/* If deleting the only file left */
if(!images) {
Poster
Owner

This is no real change but just different whitespacing, right?

This is no real change but just different whitespacing, right?
Poster

Same as above. The diff appears quite awkward because of the its refused to treat the newline separated sections as one single change.

Same as above. The diff appears quite awkward because of the its refused to treat the newline separated sections as one single change.
ciberandy reviewed 9 months ago
{"browse", 0, NULL, 'B'},
{"cycle", 0, NULL, 'C'},
{"no_sort", 0, NULL, 'D'},
{"no_error_purge", 0, NULL, 'E'},
Poster
Owner

The name of the option makes it sound as if loading errors were always ignored.
But I interpreted your code such that only errors after a command-run are ignored.

Uhm, what about taking away this condition and actually ignore all loading errors?

The name of the option makes it sound as if loading errors were always ignored. But I interpreted your code such that only errors after a command-run are ignored. Uhm, what about taking away this condition and actually ignore all loading errors?
Poster

It does two things - it doesn't remove the errored image from the image list (so at all times, regardless of whether you just ran a command). But it still advances one image if the error is the result of a command returning (you can get back to that errored image by pressing backspace to go back one image). I debated with myself over the flag: --keep_error_images would also work.

Where I use this is when cataloging a massive run of photos from a holiday (I come away with 2000 photos sometimes). When working on a scene, I use qiv-command [0-9] to move an image quickly into a directory called "qiv-0" to "qiv-9". Just a single keypress to categorise an image, then immediately advance to the next image. But if I realise I made a mistake, I just backspace one spot, press [0-9] again, and it moves the image back to the original location, and loads correctly again. I also have other keybindings - "0" followed by "K" tells qiv-command to move the file to qiv-0 (a special directory), and "K" tells the qiv-command to run exiftran on the image to rotate it losslessly. If I didn't move it into qiv-0 first, then it just runs jpegtran to do a lossy conversion (and "O" restores an erroneously rotated image). I wouldn't be able to do these exceptions if the image was removed from the list the moment the file was removed from the image list when it appeared in qiv-0.

It does two things - it doesn't remove the errored image from the image list (so at all times, regardless of whether you just ran a command). But it still advances one image if the error is the result of a command returning (you can get back to that errored image by pressing backspace to go back one image). I debated with myself over the flag: --keep_error_images would also work. Where I use this is when cataloging a massive run of photos from a holiday (I come away with 2000 photos sometimes). When working on a scene, I use qiv-command [0-9] to move an image quickly into a directory called "qiv-0" to "qiv-9". Just a single keypress to categorise an image, then immediately advance to the next image. But if I realise I made a mistake, I just backspace one spot, press [0-9] again, and it moves the image back to the original location, and loads correctly again. I also have other keybindings - "0" followed by "K" tells qiv-command to move the file to qiv-0 (a special directory), and "K" tells the qiv-command to run exiftran on the image to rotate it losslessly. If I didn't move it into qiv-0 first, then it just runs jpegtran to do a lossy conversion (and "O" restores an erroneously rotated image). I wouldn't be able to do these exceptions if the image was removed from the list the moment the file was removed from the image list when it appeared in qiv-0.
ciberandy requested changes 9 months ago
ciberandy left a comment

I really like your idea.
Please see my comments/questions.

Poster

Thanks for the comments. I've responded inline.

Thanks for the comments. I've responded inline.

Reviewers

ciberandy requested changes 9 months ago
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.