~ubuntu-branches/ubuntu/trusty/gdk-pixbuf/trusty-updates

« back to all changes in this revision

Viewing changes to gdk-pixbuf/gdk-pixbuf-loader.c

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2012-08-06 22:01:05 UTC
  • mfrom: (1.3.4)
  • Revision ID: package-import@ubuntu.com-20120806220105-v5xmrretoyk0w2xr
Tags: 2.26.2-0ubuntu1
New upstream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
321
321
                           gpointer            loader)
322
322
{
323
323
        GdkPixbufLoaderPrivate *priv = GDK_PIXBUF_LOADER (loader)->priv;
 
324
        gint width, height;
324
325
        g_return_if_fail (pixbuf != NULL);
325
326
 
 
327
        width = anim ? gdk_pixbuf_animation_get_width (anim) :
 
328
                gdk_pixbuf_get_width (pixbuf);
 
329
        height = anim ? gdk_pixbuf_animation_get_height (anim) :
 
330
                gdk_pixbuf_get_height (pixbuf);
 
331
 
326
332
        if (!priv->size_fixed) 
327
333
                {
328
334
                        /* Defend against lazy loaders which don't call size_func */
329
 
                        gint width = gdk_pixbuf_get_width (pixbuf);
330
 
                        gint height = gdk_pixbuf_get_height (pixbuf);
331
 
                        
332
335
                        gdk_pixbuf_loader_size_func (&width, &height, loader);
333
336
                }
334
337
 
335
338
        priv->needs_scale = FALSE;
336
339
        if (priv->width > 0 && priv->height > 0 &&
337
 
            (priv->width != gdk_pixbuf_get_width (pixbuf) ||
338
 
             priv->height != gdk_pixbuf_get_height (pixbuf)))
 
340
            (priv->width != width || priv->height != height))
339
341
                priv->needs_scale = TRUE;
340
342
 
341
343
        if (anim)
345
347
  
346
348
        if (priv->needs_scale) {
347
349
                priv->animation  = GDK_PIXBUF_ANIMATION (_gdk_pixbuf_scaled_anim_new (anim,
348
 
                                         (double) priv->width / gdk_pixbuf_get_width (pixbuf),
349
 
                                         (double) priv->height / gdk_pixbuf_get_height (pixbuf),
 
350
                                         (double) priv->width / width,
 
351
                                         (double) priv->height / height,
350
352
                                          1.0));
351
353
                        g_object_unref (anim);
352
354
        }