Changeset 33716 in project


Ignore:
Timestamp:
10/16/16 21:23:51 (3 years ago)
Author:
Christian Kellermann
Message:

Properly ref the exif data array, do not unref single entries, bump version

Location:
release/4/exif/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/4/exif/trunk/exif.scm

    r28433 r33716  
    285285    print-image-matching))
    286286
    287  (define-foreign-type exif-data (nonnull-c-pointer "ExifData"))
     287 (define-foreign-type exif-data (c-pointer "ExifData"))
    288288 (define exif-from-file
    289289   (foreign-lambda exif-data "exif_data_new_from_file" nonnull-c-string))
    290290 (define unref-exif-data
    291291   (foreign-lambda void "exif_data_unref" exif-data))
    292 
    293  (define-foreign-type exif-entry (nonnull-c-pointer "ExifEntry"))
     292 (define ref-exif-data
     293   (foreign-lambda void "exif_data_ref" exif-data))
     294
     295 (define-foreign-type exif-entry (c-pointer "ExifEntry"))
    294296 (define unref-exif-entry
    295297   (foreign-lambda void "exif_entry_unref" exif-entry))
     
    312314   (foreign-lambda c-string "exif_entry_get_value" exif-entry c-string unsigned-integer))
    313315
    314  (define (tag-value->string ed t #!optional (default #f))
     316(define (tag-value->string ed t)
    315317   (and-let* ((ed)
    316318              (size 1024)
     
    318320              (t (get-tag ed t))
    319321              (r (and t (string-trim-right (tag-value t s size)))))
    320              (begin (unref-exif-entry t) r)))
     322             r))
    321323
    322324(define thumbnail-size
     
    361363  (and-let* ((ed (exif-from-file f))
    362364             (_ (not (equal? (address->pointer 0) ed)))
     365             (_ (ref-exif-data ed))
    363366             (ts (map (lambda (t)
    364367                        (cons t (tag-value->string ed t)))
  • release/4/exif/trunk/exif.setup

    r27083 r33716  
    55 'exif
    66 '("exif.so" "exif.import.so")
    7  '((version 0.5)))
     7 '((version "0.7")))
  • release/4/exif/trunk/test-exif.scm

    r24619 r33716  
    11(use exif srfi-4)
    22
    3 (print (tag-alist-from-file "sony-cybershot.jpg" '(model make date-time)))
     3(print (tag-alist-from-file "img_3942.jpg" '(model make date-time)))
    44(and-let* ((thumb (thumbnail->u8vector "sony-cybershot.jpg")))
    55  (with-output-to-file "thumb.jpg" (lambda ()
Note: See TracChangeset for help on using the changeset viewer.