ext/movie.c in rmov-0.1.3 vs ext/movie.c in rmov-0.1.4

- old
+ new

@@ -344,17 +344,16 @@ &fs, 'TVOD', smSystemScript, createMovieFileDontCreateResFile); return new_movie_obj; } /* - call-seq: export_pict(filepath, time) + call-seq: export_image_type(filepath, time, ostype) - Exports a PICT file to given filepath (should end in .pct) at the given - time. Time should be a floating point in seconds. + Exports an image as the given ostype. It is best to use export_image + instead if the ostype can be determined from the filepath extension. */ - -static VALUE movie_export_pict(VALUE obj, VALUE filepath, VALUE frame_time) +static VALUE movie_export_image_type(VALUE obj, VALUE filepath, VALUE frame_time, VALUE ostype_obj) { GraphicsImportComponent component; PicHandle picture; Handle handle; FSSpec fs; @@ -379,11 +378,11 @@ err = GraphicsImportSetDataHandle(component, handle); if (err != noErr) rb_raise(eQuickTime, "Error %d occurred while setting graphics importer data handle for %s.", err, RSTRING(filepath)->ptr); - err = GraphicsImportExportImageFile(component, 0, 0, &fs, smSystemScript); + err = GraphicsImportExportImageFile(component, OSTYPE(RSTRING(ostype_obj)->ptr), 0, &fs, smSystemScript); if (err != noErr) rb_raise(eQuickTime, "Error %d occurred while exporting pict to file %s.", err, RSTRING(filepath)->ptr); CloseComponent(component); DisposeHandle(handle); @@ -448,10 +447,10 @@ rb_define_method(cMovie, "clone_section", movie_clone_section, 2); rb_define_method(cMovie, "clip_section", movie_clip_section, 2); rb_define_method(cMovie, "changed?", movie_changed, 0); rb_define_method(cMovie, "clear_changed_status", movie_clear_changed_status, 0); rb_define_method(cMovie, "flatten", movie_flatten, 1); - rb_define_method(cMovie, "export_pict", movie_export_pict, 2); + rb_define_method(cMovie, "export_image_type", movie_export_image_type, 3); rb_define_method(cMovie, "dispose", movie_dispose, 0); rb_define_method(cMovie, "poster_time", movie_get_poster_time, 0); rb_define_method(cMovie, "poster_time=", movie_set_poster_time, 1); rb_define_method(cMovie, "new_track", movie_new_track, 2); }