Evas JPEG loader: if both width and height scale dimensions are given, we want to...
authorillogict <illogict@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 31 Aug 2010 06:50:48 +0000 (06:50 +0000)
committerillogict <illogict@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 31 Aug 2010 06:50:48 +0000 (06:50 +0000)
 Fixes some ugly views if width and height factors are too much different.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@51774 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/modules/loaders/jpeg/evas_image_load_jpeg.c

index 65f7fc7..005232c 100644 (file)
@@ -136,8 +136,11 @@ evas_image_load_file_head_jpeg_internal(Image_Entry *ie, FILE *f, int *error)
             h2 = (ie->load_opts.w * h) / w;
             if ((ie->load_opts.h > 0) && (h2 > ie->load_opts.h))
               {
+                 int w3;
                  h2 = ie->load_opts.h;
-                 w2 = (ie->load_opts.h * w) / h;
+                 w3 = (ie->load_opts.h * w) / h;
+                 if (w3 > w2)
+                   w2 = w3;
               }
          }
        else if (ie->load_opts.h > 0)