Is there a way to tell how many pics are on a card? or when the card is full? - Script Writing - CHDK Forum supplierdeeply

Is there a way to tell how many pics are on a card? or when the card is full?

  • 9 Replies
  • 3511 Views
Advertisements
Is there a way to tell how many pics are on a memory card? or how much free space there is?

I would like to make a script that can tell when images need to be deleted. i'm successfully deleting images on my a570is.

*

Online reyalp

  • ******
  • 12446
try get_free_disk_space
Don't forget what the H stands for.

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
quote from the wiki:

get_disk_size
get_free_disk_space

    Returns values in KB. You can build scripts now which stop when specific disk limit exceeded. For easier calculation divide by 1024 to return value in MB.

    Syntax: x=get_disk_size, x=get_free_disk_space

    Example, to print the space left in megabytes, print get_free_disk_space/1024 (this, among some others, is one of those commands that acts as its own variable)


get_jpg_count
get_raw_count

    Syntax: x=get_jpg_count, x=get_raw_count (acts as its own variable which may be assigned to other variables)

    Returns the calculated value of how many JPG or RAW shot space is left available on the SD card. (JPG value is approximated and taken from an average of file-sizes, using Canon's own algorithm, the same as shots remaining left in your EVF/LCD display.) Use this command to detect when not enough space is remaining for your required script task to either end the script or shut_down the camera.

with these commands you should be able to do the stuff you wanna :)

edit: reyalp beat me to it, but i explained further ;)

unfortunately i can't seem to use those commands. are they part of a particular build? i believe i'm building with trunk - with a few changes so i can delete images on my a570is (by switching into playback mode)


*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
these commands exist in allbest for a long time. hm.

ok, looks like i need to go over my build.

yeah, looks like it works with the new merge. grm...i can't build the new merge!

In file included from gui.c:32:
curves.h:15: error: array type has incomplete element type

guess i'll take a look at my changes to my prev. checkout.

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
well we merged the juciphox branch with the trunk (better: exchanged it). i guess you use gcc 4x?

i do, but why are these projects so dependent on gcc versions? trunk was building fine before. i can look into installing 3.6 whatever but it looks poorly maintained for os x.

or could i change the build script to work with 4.x?


*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
starting in gcc 4 they got stricter, regarding arrays, or so i was told by google.
i dont know if it will work with 4.x :(

I got it working although i really don't understand what it does...

Print Page - Instant video uploads using CHDK and Eye-fi

Index: core/curves.h
===================================================================
--- core/curves.h   (revision 499)
+++ core/curves.h   (working copy)
@@ -12,7 +12,7 @@
 extern void curve_load();
 extern void drcurve_load(const char *fn);
 extern void curve_apply();
-extern unsigned short drcurve0[][];
+extern unsigned short drcurve0[][CURVE_SIZE];
 // extern void default_curve(int n);
 //-------------------------------------------------------------------

 

Related Topics