[Dillo-dev] Weirdly scaled images (again)

11 views
Skip to first unread message

August Karlstrom

unread,
Jul 28, 2015, 11:37:15 AM7/28/15
to dill...@dillo.org
The Dillo user v4hn recently sent a message to this list regarding
incorrect image scaling. She or he expresses exactly what I have on my
mind:

http://lists.dillo.org/pipermail/dillo-dev/2015-July/010596.html

I use Dillo 3.0.4 from the Debian stable repositories and I experience
the ugly image scaling on many sites, for instance on the two largest
news (paper) sites here in Sweden:

http://www.dn.se
http://www.svd.se

I can imagine that most people trying out Dillo will find the
stretched-out images very off-putting. Changing the aspect ratio of an
image is something you almost never want do do, and changing the aspect
ratio of a photo is a big no-no. What's your view on this? Do you use
Dillo with CSS disabled? Actually, I think it would be better if image
scaling was not implemented at all, rather than broken like this.

I'm not familiar with the Dillo code base but I'm a programmer
proficient with C and I know some C++, so if I (with some hints) can
help I would be more than glad to.


Regards,

August

_______________________________________________
Dillo-dev mailing list
Dill...@dillo.org
http://lists.dillo.org/cgi-bin/mailman/listinfo/dillo-dev

August Karlstrom

unread,
Aug 16, 2015, 5:16:27 AM8/16/15
to dill...@dillo.org
On 2015-07-28 17:34, August Karlstrom wrote:
> Changing the aspect ratio of an image is something you almost never
> want do do, and changing the aspect ratio of a photo is a big no-no.
> What's your view on this? Do you use Dillo with CSS disabled?
> Actually, I think it would be better if image scaling was not
> implemented at all, rather than broken like this.

Apparently some (or most?) browsers, Firefox for instance, do uniform
scaling when only one of the width or height attribute is set on an img
element. Dillo does non-uniform scaling and changes only the specified
dimension. Here is what the reference has to say about it:

"When the object is an image, it is scaled. User agents should do their
best to scale an object or image to match the width and height specified
by the author."

http://www.w3.org/TR/html401/struct/objects.html#edef-IMG

It seems to be a question of interpretation.


-- August

August Karlstrom

unread,
Aug 17, 2015, 3:37:21 PM8/17/15
to dill...@dillo.org
On 2015-08-02 16:52, August Karlstrom wrote:
> Apparently some (or most?) browsers, Firefox for instance, do uniform
> scaling when only one of the width or height attribute is set on an img
> element. Dillo does non-uniform scaling and changes only the specified
> dimension. Here is what the reference has to say about it:
>
> "When the object is an image, it is scaled. User agents should do their
> best to scale an object or image to match the width and height specified
> by the author."
>
> http://www.w3.org/TR/html401/struct/objects.html#edef-IMG
>
> It seems to be a question of interpretation.

I have posted the question on Stack Overflow:

http://stackoverflow.com/questions/31773161/specifying-only-width-or-height-for-an-img-element


-- August

Stephen Paul Weber

unread,
Aug 17, 2015, 3:47:02 PM8/17/15
to August Karlstrom, dill...@dillo.org
>Apparently some (or most?) browsers, Firefox for instance, do uniform
>scaling when only one of the width or height attribute is set on an img
>element.

Yes, this is the right thing to do and is the only way images should
generally be used on the web (since you always want uniform scaling and
don't get it when setting both width and height, so only one of width or
height should ever be set).

Jorge Arellano Cid

unread,
Aug 18, 2015, 6:48:04 PM8/18/15
to dill...@dillo.org
On Mon, Aug 17, 2015 at 09:35:09PM +0200, August Karlstrom wrote:
> On 2015-08-02 16:52, August Karlstrom wrote:
> >Apparently some (or most?) browsers, Firefox for instance, do uniform
> >scaling when only one of the width or height attribute is set on an img
> >element. Dillo does non-uniform scaling and changes only the specified
> >dimension. Here is what the reference has to say about it:
> >
> >"When the object is an image, it is scaled. User agents should do their
> >best to scale an object or image to match the width and height specified
> >by the author."
> >
> >http://www.w3.org/TR/html401/struct/objects.html#edef-IMG
> >
> >It seems to be a question of interpretation.
>
> I have posted the question on Stack Overflow:
>
> http://stackoverflow.com/questions/31773161/specifying-only-width-or-height-for-an-img-element

FWIW, IMHO, it should scale respecting the original image ratio
(just pragmatics).

AFAIR, it was/could-be done this way by dillo (using CSS hints) but
somewhere in the redesign (GROWS) these image-size hints were lost.
@Sebastian, @Johannes, please correct me if I'm wrong here.

--
Cheers
Jorge.-

August Karlstrom

unread,
Aug 19, 2015, 3:42:21 AM8/19/15
to dill...@dillo.org
On 2015-08-19 00:45, Jorge Arellano Cid wrote:
> On Mon, Aug 17, 2015 at 09:35:09PM +0200, August Karlstrom wrote:
>> I have posted the question on Stack Overflow:
>>
>> http://stackoverflow.com/questions/31773161/specifying-only-width-or-height-for-an-img-element
>
> FWIW, IMHO, it should scale respecting the original image ratio
> (just pragmatics).
>
> AFAIR, it was/could-be done this way by dillo (using CSS hints) but
> somewhere in the redesign (GROWS) these image-size hints were lost.
> @Sebastian, @Johannes, please correct me if I'm wrong here.

After a little experimentation it seems like the image ratio is
respected when width or height is set in pixels but not when a
percentage is used, for instance

<img alt="Some image" src="some-image.jpg" width="25%" />

I use Dillo version 3.0.4 in Debian Jessie (stable).


-- August

Johannes Hofmann

unread,
Aug 19, 2015, 11:35:13 AM8/19/15
to dill...@dillo.org
Hi Jorge,

On Tue, Aug 18, 2015 at 07:45:09PM -0300, Jorge Arellano Cid wrote:
> On Mon, Aug 17, 2015 at 09:35:09PM +0200, August Karlstrom wrote:
> > On 2015-08-02 16:52, August Karlstrom wrote:
> > >Apparently some (or most?) browsers, Firefox for instance, do uniform
> > >scaling when only one of the width or height attribute is set on an img
> > >element. Dillo does non-uniform scaling and changes only the specified
> > >dimension. Here is what the reference has to say about it:
> > >
> > >"When the object is an image, it is scaled. User agents should do their
> > >best to scale an object or image to match the width and height specified
> > >by the author."
> > >
> > >http://www.w3.org/TR/html401/struct/objects.html#edef-IMG
> > >
> > >It seems to be a question of interpretation.
> >
> > I have posted the question on Stack Overflow:
> >
> > http://stackoverflow.com/questions/31773161/specifying-only-width-or-height-for-an-img-element
>
> FWIW, IMHO, it should scale respecting the original image ratio
> (just pragmatics).
>
> AFAIR, it was/could-be done this way by dillo (using CSS hints) but
> somewhere in the redesign (GROWS) these image-size hints were lost.
> @Sebastian, @Johannes, please correct me if I'm wrong here.

as it was mentioned in this thread already the image scaling issue
is fixed for quite some time in the main line of the dillo repo.

Cheers,
Johannes

August Karlstrom

unread,
Aug 19, 2015, 4:01:05 PM8/19/15
to dill...@dillo.org
On 2015-08-19 17:32, Johannes Hofmann wrote:
> as it was mentioned in this thread already the image scaling issue
> is fixed for quite some time in the main line of the dillo repo.

I have downloaded and installed the latest Dillo version 3.1-dev. With
the test file below the two images have the same size despite setting
width to 25 percent on the second image. Do you get the same result?

-- August


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Dillo Test</title>
</head>
<body>
<div><img alt="Dillo logo" src="http://www.dillo.org/db1.png" /></div>
<div><img alt="Dillo logo" src="http://www.dillo.org/db1.png"
width="25%" /></div>
</body>
</html>

Johannes Hofmann

unread,
Aug 19, 2015, 5:42:41 PM8/19/15
to dill...@dillo.org
On Wed, Aug 19, 2015 at 09:58:51PM +0200, August Karlstrom wrote:
> On 2015-08-19 17:32, Johannes Hofmann wrote:
> > as it was mentioned in this thread already the image scaling issue
> > is fixed for quite some time in the main line of the dillo repo.
>
> I have downloaded and installed the latest Dillo version 3.1-dev. With
> the test file below the two images have the same size despite setting
> width to 25 percent on the second image. Do you get the same result?

yes, I get the same result. Interestingly it works ok without the
enclosing <div>

Johannes

Jorge Arellano Cid

unread,
Aug 20, 2015, 12:32:29 PM8/20/15
to dill...@dillo.org
On Wed, Aug 19, 2015 at 05:32:51PM +0200, Johannes Hofmann wrote:
> Hi Jorge,
>
> On Tue, Aug 18, 2015 at 07:45:09PM -0300, Jorge Arellano Cid wrote:
> > On Mon, Aug 17, 2015 at 09:35:09PM +0200, August Karlstrom wrote:

> > [...]
> >
> > FWIW, IMHO, it should scale respecting the original image ratio
> > (just pragmatics).
> >
> > AFAIR, it was/could-be done this way by dillo (using CSS hints) but
> > somewhere in the redesign (GROWS) these image-size hints were lost.
> > @Sebastian, @Johannes, please correct me if I'm wrong here.
>
> as it was mentioned in this thread already the image scaling issue
> is fixed for quite some time in the main line of the dillo repo.

Yes, but it still has some problems, as shown in August's example.

I usually find image-scaling issues while surfing, so I *knew* there
was something there, but never found the time to dig it.

Today I made a test page (by no means complete yet), and it shows there
are plenty of things right, and some others ignored (attached).

The good news is that it seems the mechanisms for solving scaling are
still there, and that the main issue comes with percentages.

As August's example tests percentages in old style HTML (not CSS),
I tested mingling a bit of CSS.

If Sebastian confirms me there's not someting fundamentally lacking
within percentage scaling, I could work on this issue trying to nail
the bizantine plethora of possible combinations. :-P

FWIW, in the test-page comments, FF means Firefox.

--
Cheers
Jorge.-
img.html
smile.gif

August Karlstrom

unread,
Sep 18, 2015, 6:19:12 AM9/18/15
to dill...@dillo.org
On 2015-08-19 23:40, Johannes Hofmann wrote:
> On Wed, Aug 19, 2015 at 09:58:51PM +0200, August Karlstrom wrote:
>> On 2015-08-19 17:32, Johannes Hofmann wrote:
>>> as it was mentioned in this thread already the image scaling issue
>>> is fixed for quite some time in the main line of the dillo repo.
>>
>> I have downloaded and installed the latest Dillo version 3.1-dev. With
>> the test file below the two images have the same size despite setting
>> width to 25 percent on the second image. Do you get the same result?
>
> yes, I get the same result. Interestingly it works ok without the
> enclosing <div>

If anyone running Dillo 3.0.4 is interested I have made a patch which
fixes the image scaling issue (see attachment).

With the test document below, the Dillo logo should keep its aspect
ratio when the Dillo browser window is resized.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test</title>
</head>
<body>
<div><img src="http://www.dillo.org/db1.png" alt="Dillo logo"
width="50%" /></div>
</body>
</html>


-- August
image-scaling.patch
Reply all
Reply to author
Forward
0 new messages