img->geom.height *= scale;
}
- if (img->title) /* strip filename to part after last /. */
+ if (img->title) /* strip filename to part between last "/" and last ".". */
{
char *s = strrchr (img->title, '/');
if (s) strcpy (img->title, s+1);
+ s = strrchr (img->title, '.');
+ if (s) *s = 0;
}
if (debug_p)
int vp_h = MI_HEIGHT(mi);
int img_w = sp->img->geom.width;
int img_h = sp->img->geom.height;
- int min_w, min_h, max_w, max_h;
+ int min_w, max_w;
double ratio = (double) img_h / img_w;
if (letterbox_p)
{
min_w = img_w;
- min_h = img_h;
}
else
{
if (img_w < vp_w)
- {
- min_w = vp_w;
- min_h = img_h * (float) vp_w / img_w;
- }
+ min_w = vp_w;
else
- {
- min_w = img_w * (float) vp_h / img_h;
- min_h = vp_h;
- }
+ min_w = img_w * (float) vp_h / img_h;
}
max_w = min_w * 100 / zoom;
- max_h = min_h * 100 / zoom;
sp->from.w = min_w + frand ((max_w - min_w) * 0.4);
sp->to.w = max_w - frand ((max_w - min_w) * 0.4);