load_size option now accept -1xH or Wx-1

If one want to load image at a given height or width and the other
dimension should be large enough to make it possible, give -1 as the
other coordinate and this will happen.



SVN revision: 38845
This commit is contained in:
Gustavo Sverzut Barbieri 2009-01-29 16:45:14 +00:00
parent 01ea61f11d
commit 66b3a0a0f1
1 changed files with 12 additions and 6 deletions

View File

@ -120,14 +120,20 @@ evas_image_load_file_head_jpeg_internal(Image_Entry *ie, FILE *f)
w = (w * ie->load_opts.dpi) / 90.0;
h = (h * ie->load_opts.dpi) / 90.0;
}
else if ((ie->load_opts.w > 0) &&
(ie->load_opts.h > 0))
else if ((ie->load_opts.w) && (ie->load_opts.h))
{
int w2, h2;
w2 = ie->load_opts.w;
h2 = (ie->load_opts.w * h) / w;
if (h2 > ie->load_opts.h)
if (ie->load_opts.w > 0)
{
w2 = ie->load_opts.w;
h2 = (ie->load_opts.w * h) / w;
if ((ie->load_opts.h > 0) && (h2 > ie->load_opts.h))
{
h2 = ie->load_opts.h;
w2 = (ie->load_opts.h * w) / h;
}
}
else if (ie->load_opts.h > 0)
{
h2 = ie->load_opts.h;
w2 = (ie->load_opts.h * w) / h;