google-code-export / candydolldb

Automatically exported from code.google.com/p/candydolldb
0 stars 0 forks source link

Stretched instead of aspect-ratio scaled thumbnails #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open any model's set page that contains only portrait-ratio images, e.g. 
VikaZ02, VikaZ04 or VikaZ10.
2. See how ugly this looks.

What is the expected output? What do you see instead?
I would like to see an aspect-ratio scaled thumbnail. Instead I see a skewed 
image.

Original issue reported on code.google.com by fwp...@gmail.com on 22 Feb 2012 at 6:15

GoogleCodeExporter commented 9 years ago
i believe it is the following workaround in class.model that is causing this, 
because i have noticed it myself.

if(!$Images)
{
       /* Work-around for returning at least ONE image when none fit the specified  aspect ratio */
      $whereClause = sprintf('model_id = %1$d AND mut_deleted = -1', $this->getID());
if($SetID)
{
$whereClause .= sprintf(' AND set_id = %1$d', $SetID);
}
}

might be a good idea to get the image width and height of the returned file, 
and multiply it by a factor that will give it an aspect-ratio scale

Original comment by mranimos...@gmail.com on 22 Feb 2012 at 7:10

GoogleCodeExporter commented 9 years ago
I think you're right. I know the man who wrote that work-around :)

The download_image.php processes the image correctly. For the landscape-version 
of VikaZ02, for example, it returns a 100x150 pixels aspect scaled image. 
That's nice.

The browser, however, sees the width="225" height="150", and stretched the 
image accordingly.

I propose to work on a javascript (jQuery) solution for de-stretching and then 
centering the specific images. I'll give this some thought.

What do you think?

FWieP

Original comment by fwp...@gmail.com on 22 Feb 2012 at 11:26

GoogleCodeExporter commented 9 years ago
why not just remove the width and height tags from the <img> tag, and add 
text-align: center to the .SetThumbImageWrapper style.css class. 

Only problem with that is the delete-image overlay doesn't center with the img, 
so some fiddling will be needed

Original comment by mranimos...@gmail.com on 22 Feb 2012 at 10:29

GoogleCodeExporter commented 9 years ago
Remove the width-attribute, brilliant! No client side fiddling with 
loading/analyzing images, no server side queries for determining the set's 
image ratio... brilliant. Thanks.

About the overlay, I knew it would need some tweaking before being OK. I'll 
look into this. I'll check in my working copy (r324) and begin working on that 
overlay.

FWieP

Original comment by fwp...@gmail.com on 23 Feb 2012 at 5:33

GoogleCodeExporter commented 9 years ago
Resolved in r329, with one remark: I had to give up the text-align:center.

If anyone has a better overlay-and-delete up their sleeve, please say so. For 
now, I would call this matter closed, issue resolved. Agreed?

Portrait-only sets are a minority anyhow :-)

FWieP

Original comment by fwp...@gmail.com on 23 Feb 2012 at 5:53

GoogleCodeExporter commented 9 years ago
Issue resolved, as per consensus.

Original comment by fwp...@gmail.com on 25 Feb 2012 at 8:44