mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-02-04 20:27:45 +00:00
(Qduration) [MAC_OS]: New variable.
(syms_of_image) [MAC_OS]: Intern and staticpro it. [MAC_OS] (gif_load): Save image extension data in img->data.lisp_val. [MAC_OSX] (image_load_quartz2d): Use cfstring_create_with_utf8_cstring instead of cfstring_create_with_string.
This commit is contained in:
parent
2f291aac74
commit
fb8b2fc348
21
src/image.c
21
src/image.c
@ -2628,7 +2628,7 @@ image_load_quartz2d (f, img, png_p)
|
||||
UNGCPRO;
|
||||
return 0;
|
||||
}
|
||||
path = cfstring_create_with_string (file);
|
||||
path = cfstring_create_with_utf8_cstring (SDATA (file));
|
||||
url = CFURLCreateWithFileSystemPath (NULL, path,
|
||||
kCFURLPOSIXPathStyle, 0);
|
||||
CFRelease (path);
|
||||
@ -7899,6 +7899,8 @@ gif_load (f, img)
|
||||
#else /* !HAVE_GIF */
|
||||
|
||||
#ifdef MAC_OS
|
||||
static Lisp_Object Qduration;
|
||||
|
||||
static int
|
||||
gif_load (f, img)
|
||||
struct frame *f;
|
||||
@ -7920,7 +7922,8 @@ gif_load (f, img)
|
||||
RGBColor bg_color;
|
||||
int width, height;
|
||||
XImagePtr ximg;
|
||||
TimeValue time;
|
||||
TimeScale time_scale;
|
||||
TimeValue time, duration;
|
||||
int ino;
|
||||
CGrafPtr old_port;
|
||||
GDHandle old_gdh;
|
||||
@ -8028,6 +8031,7 @@ gif_load (f, img)
|
||||
image, img->spec);
|
||||
goto error;
|
||||
}
|
||||
time_scale = GetMediaTimeScale (media);
|
||||
|
||||
specified_bg = image_spec_value (img->spec, QCbackground, NULL);
|
||||
if (!STRINGP (specified_bg) ||
|
||||
@ -8053,7 +8057,7 @@ gif_load (f, img)
|
||||
SetGWorld (old_port, old_gdh);
|
||||
SetMovieActive (movie, 1);
|
||||
SetMovieGWorld (movie, ximg, NULL);
|
||||
SampleNumToMediaTime (media, ino + 1, &time, NULL);
|
||||
SampleNumToMediaTime (media, ino + 1, &time, &duration);
|
||||
SetMovieTimeValue (movie, time);
|
||||
MoviesTask (movie, 0L);
|
||||
DisposeTrackMedia (media);
|
||||
@ -8061,6 +8065,12 @@ gif_load (f, img)
|
||||
DisposeMovie (movie);
|
||||
if (dh)
|
||||
DisposeHandle (dh);
|
||||
|
||||
/* Save GIF image extension data for `image-extension-data'.
|
||||
Format is (count IMAGES duration DURATION). */
|
||||
img->data.lisp_val = list4 (Qcount, make_number (nsamples), Qduration,
|
||||
make_float ((double)duration / time_scale));
|
||||
|
||||
/* Maybe fill in the background field while we have ximg handy. */
|
||||
if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
|
||||
IMAGE_BACKGROUND (img, f, ximg);
|
||||
@ -8616,6 +8626,11 @@ non-numeric, there is no explicit limit on the size of images. */);
|
||||
ADD_IMAGE_TYPE(Qgif);
|
||||
#endif
|
||||
|
||||
#ifdef MAC_OS
|
||||
Qduration = intern ("duration");
|
||||
staticpro (&Qduration);
|
||||
#endif
|
||||
|
||||
#if defined (HAVE_PNG) || defined (MAC_OS)
|
||||
Qpng = intern ("png");
|
||||
staticpro (&Qpng);
|
||||
|
Loading…
x
Reference in New Issue
Block a user