Erase CRW/CR2/DNG files without corresponding JPG - page 8 - Feature Requests - CHDK Forum  

Erase CRW/CR2/DNG files without corresponding JPG

  • 79 Replies
  • 28964 Views
*

Offline wontolla

  • ****
  • 413
  • S3 & G9 & A720
Re: Erase JPG along with corresponding CRW in any folder - done
« Reply #70 on: 01 / April / 2008, 13:30:57 »
Advertisements
Thank you for the sugestions GrAnd.
Quote
Just a minor speedup suggestion: to insert "break;" just after each "found=1;".
Minor? That could reduce the effort/time to a half! In the average case. No sense in keep searching if it's already found, right?
My teacher told me to avoid using "goto" or "break" statements. May be he wasn't right after all.

Quote
I suspect here should be "selected_item", not "selected_file"
Since this is the case when the list is already generated by the File Browser, the names of the files are already in the structure, so I can use "selected_file". In fact, this is the first part of the code I wrote, inspired in the "fselect_delete_file_cb" function.

Quote
What about a deleted file with .CR* extension?
What do you mean? If it is already deleted, we don't need to search for its JPG partner.

Quote
Minor: Extra unnecessary check: "de2->name[9] == 'J'"  -> so it can'be "de2->name[9] == 'C'"
True, I'll remove it for the sake of simplicity.

GrAnd, any way to know if the amount of memory is not enough for this application? Or what could be the cause of camera hanging sometimes and sometimes it simply works!

Thanks!


*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: Erase JPG along with corresponding CRW in any folder - done
« Reply #71 on: 01 / April / 2008, 13:48:02 »
My teacher told me to avoid using "goto" or "break" statements. May be he wasn't right after all.
Regarding "goto" - yes, it could be weird. But "break" is very useful sometimes. Especial in case if you have a lot of conditions in the cycle. Of course, the appropriate condition can be placed in "while" statement, e.g.
Code: (c) [Select]
        while (!found && (de4=readdir(d4)) != NULL)

Quote
What about a deleted file with .CR* extension?
What do you mean? If it is already deleted, we don't need to search for its JPG partner.
I mean in that line(s) a deleted file with CRW/CR2 extension can be caught.


GrAnd, any way to know if the amount of memory is not enough for this application? Or what could be the cause of camera hanging sometimes and sometimes it simply works!
But you do not use a dynamic memory (no malloc()/free() functions I see).
CHDK Developer.

Re: Erase JPG along with corresponding CRW in any folder - done
« Reply #72 on: 17 / April / 2008, 20:32:08 »
so is this in the cvs? or not ready yet. but can I make a build test with raw deletion for my s5is...
sorry for the dummy Q.
thats the only other thing that would be handy, as I have to download all images, then go through all crw/jpg to find the crw files without matching jpg's and delete before running my normal photo process...


*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Erase JPG along with corresponding CRW in any folder - done
« Reply #73 on: 18 / April / 2008, 00:51:17 »
not in svn yet. you can manually merge the changes and compile on your own though :)


*

Offline wontolla

  • ****
  • 413
  • S3 & G9 & A720
Re: Erase JPG along with corresponding CRW in any folder - done
« Reply #74 on: 24 / April / 2008, 18:15:17 »
It's been weeks since I worked on this. Sorry for the delay.

To avoid confusion, I moved the links and the explanation of this feature to the first post of this thread. Any other link is outdated.

Regarding the "hanging" problems some of you reported: I've been able to reproduce them only twice, so I can't still find the cause. GrAnd mentioned somewhere else a watchdog timeout, maybe it has something to do here. I'll continue experimenting, but I guess we'll have to get rid of the "Delete all RAW files in DCIM folder" function.

Have fun!

Re: Erase JPG along with corresponding CRW in any folder - done
« Reply #75 on: 25 / April / 2008, 07:52:26 »
Regarding the "hanging" problems some of you reported: I've been able to reproduce them only twice, so I can't still find the cause. GrAnd mentioned somewhere else a watchdog timeout, maybe it has something to do here. I'll continue experimenting, but I guess we'll have to get rid of the "Delete all RAW files in DCIM folder" function.

Just my thoughts on why I would never use this feature and the dangers. With my own DSLR experience I on a trip 1500miles from home at Salt Lake City, very beautiful city. Shooting as I normaly do I ran out of space on my cards. At this time I did not have a way to backup my cards either. So I started deleting images I did not need. I did this over a course of three hours, takes pictures delete some. When I got home I had found that half the cards were filled corrupted files.

This only happened to me a year and half ago. From that time I have not deleted a single image from any of my cards with the camera OS. My DLSR's cards are formatted each time before I use them. My CHDK cards, I use the camera feature "Delete All Images"

I just don't like taking chances with my images.

*

Offline wontolla

  • ****
  • 413
  • S3 & G9 & A720
Re: Erase JPG along with corresponding CRW in any folder - done
« Reply #76 on: 25 / April / 2008, 14:26:57 »
The "hanging" problems consist in the camera shutting down, not images beeing lost.

You are right, the best way to solve the space problem is buying more cards or a portable storage device. The PurgeRAW feature is "just in case" you don't have these options at the time.

I started implementing this because I had the opposite experience than you: In a trip, I run out of space and started deleting bad pictures and continue taking snaps, I had no problems. I guess every one of us have deleted pictures in camera before (with or without CHDK) without any problems. I just thought it was a good idea to be able to erase RAW files too and claim much more space.

Quote
My CHDK cards, I use the camera feature "Delete All Images"
"PurgeRAW" is the same C code as "Delete All Images". I just added a searching capability.

IMO you just had bad luck, it can happen to anybody with DSLR or P&S, with CHDK or Canon's firmware, with PurgeRAW or without it.

BTW. Thanks for the DSLR tip. Now if I ever get a DSLR it won't be because of reliability.



« Last Edit: 25 / April / 2008, 14:30:30 by wontolla »

*

Offline lukg

  • ***
  • 162
  • Eos 450D+18-55is+55-250is & Powershot S5is - 1.01a
Re: Erase JPG along with corresponding CRW in any folder - done
« Reply #77 on: 17 / June / 2008, 07:14:21 »
Ok, Wontolla thanks. I tried with your build too, but with no success. I took 2 pictures (jpg+raw), deleted jpgs with canon interface, opened chdk file manager, positioned over DCIM folder and selected PURGE RAW, asked me if I was sure.
Crw files are still there (in 100CANON subdir). I tried to position over the subfolder containing the raw files, but with the same result. What can I do?

EDIT: If I enter the directory containing raw files, the "purge raw" function works. Maybe am I wrong about how "purge raw" works?
« Last Edit: 17 / June / 2008, 07:55:20 by lukg »


*

Offline wontolla

  • ****
  • 413
  • S3 & G9 & A720
Re: Erase JPG along with corresponding CRW in any folder - done
« Reply #78 on: 17 / June / 2008, 14:57:33 »
You just described the three ways PurgeRAW works. But it looks like only one works in your case.

It is not the first time someone reports a problem when trying to purge ALL raws in DCIM folder. But it seems to work when erasing directly "inside" a particular folder (as it was planned at the begining of this feature).

The reason I added the hability to search through all folders inside DCIM (100CANON, 101CANON, 102CANON etc) is because from time to time ONE of the raw files is saved in a different folder than its jpg companion, so the program would always erase this raw file because it's unable to find the corresponding jpg.

I will continue working on this, but I guess that in the end, we will have to forget about the "searching in all folders" hability.

*

Offline lukg

  • ***
  • 162
  • Eos 450D+18-55is+55-250is & Powershot S5is - 1.01a
Re: Erase JPG along with corresponding CRW in any folder - done
« Reply #79 on: 17 / June / 2008, 19:01:29 »
Thank you for your reply! Anyway, It's not a problem for me, i will use this great function in the way it works! Thanks again!

 

Related Topics