Site config - media dimensions seem to have stopped working

8 views
Skip to first unread message

Simon Smithies

unread,
Dec 8, 2011, 3:05:54 AM12/8/11
to Zotonic users
Hi guys,

My site's users have inserted a very large facebook link image in
their test site (see http://coolair.twigsolutions.co.nz:8000/) , and
it's displaying at its native size -- basically ignoring the image
size commands from the editor. In fact I think now none of the images
are responding to the size commands, it's just really obvious with
that one!

I'm aware of the media_dimensions setting in site config, and have
tried using that to force a size, but that doesn't seem to have any
effect either.

Any ideas?

- Simon

Konstantin Nikiforov

unread,
Dec 8, 2011, 3:15:53 AM12/8/11
to zotoni...@googlegroups.com
> facebook_logo.jpg()(8E207313F0F32414295288E80C091751).jpg

width and height is not set or undefined. Please show the code of image-tag
and related parts or site config.


В Thu, 8 Dec 2011 00:05:54 -0800 (PST)
Simon Smithies <simon.s...@gmail.com> пишет:

signature.asc

Ahmed Al-Saadi

unread,
Dec 8, 2011, 3:18:51 AM12/8/11
to zotoni...@googlegroups.com, Simon Smithies
In all cases where I had a problem with image processing, it was because
I forgot to install ImageMagick that supplies two required scripts
(built with correct image libraries installed; e.g., png). If this
doesn't ring a bell, look here: http://zotonic.com/install

Cheers,
Ahmed

Simon Smithies

unread,
Dec 9, 2011, 3:08:38 PM12/9/11
to Zotonic users
Hi Konstantin.

The image tag is getting rendered like this:

<figure class="image-wrapper block-level-image">
<img src='/image/2011/11/2/facebook_logo.jpg
%28%29%288E207313F0F32414295288E80C091751%29.jpg'
width='1125' height='338' class='block' alt='FB Link'/>
</figure>

I get this regardless of my config settings. Here's the config setting
I've tried:

% Media Dimensions
{media_dimensions, "101x101,201x201,301x301"},

- Simon

On Dec 8, 9:15 pm, Konstantin Nikiforov <hellla...@gmail.com> wrote:
> > facebook_logo.jpg()(8E207313F0F32414295288E80C091751).jpg
>
> width and height is not set or undefined. Please show the code of image-tag
> and related parts or site config.
>
> В Thu, 8 Dec 2011 00:05:54 -0800 (PST)

> Simon Smithies <simon.smith...@gmail.com> пишет:


>
>
>
>
>
>
>
> > Hi guys,
>
> > My site's users have inserted a very large facebook link image in

> > their test site (seehttp://coolair.twigsolutions.co.nz:8000/) , and


> > it's displaying at its native size -- basically ignoring the image
> > size commands from the editor. In fact I think now none of the images
> > are responding to the size commands, it's just really obvious with
> > that one!
>
> > I'm aware of the media_dimensions setting in site config, and have
> > tried using that to force a size, but that doesn't seem to have any
> > effect either.
>
> > Any ideas?
>
> > - Simon
>

>  signature.asc
> < 1KViewDownload

Simon Smithies

unread,
Dec 9, 2011, 3:22:17 PM12/9/11
to Zotonic users
Hi Ahmed,

If I do an "identify -list format" IM returns me a big list of
supported formats, which seems to include .jpg:

JPEG* JPEG rw- Joint Photographic Experts Group JFIF
format (80)
JPG* JPEG rw- Joint Photographic Experts Group JFIF
format (80)

So I don't /think/ it's an ImageMagick problem... but then IM's a bit
of a black art to me.

- Simon

On Dec 8, 9:18 pm, Ahmed Al-Saadi <thaterlang...@gmail.com> wrote:
> In all cases where I had a problem with image processing, it was because
> I forgot to install ImageMagick that supplies two required scripts
> (built with correct image libraries installed; e.g., png). If this
> doesn't ring a bell, look here:http://zotonic.com/install
>
> Cheers,
> Ahmed
>
> On 12/8/11 3:05 AM, Simon Smithies wrote:
>
>
>
>
>
>
>
> > Hi guys,
>
> > My site's users have inserted a very large facebook link image in

> > their test site (seehttp://coolair.twigsolutions.co.nz:8000/) , and

Konstantin Nikiforov

unread,
Dec 9, 2011, 3:31:03 PM12/9/11
to zotoni...@googlegroups.com
I'm not used show_media filter before, but according to source code
you need to:

1. Go to /admin/config
2. Press "make a new config setting" button
3. Module = site,
Key = media_dimensions,
Value = 101x101,201x201,301x301
4. And press ok button.

Please try this, but i'm not sure that it will work 100%.


В Fri, 9 Dec 2011 12:08:38 -0800 (PST)
Simon Smithies <simon.s...@gmail.com> пишет:

> Hi Konstantin.

signature.asc

Simon Smithies

unread,
Dec 9, 2011, 4:44:48 PM12/9/11
to Zotonic users
I'm afraid that's had no effect.

You've just taught me something though! When I read about the
media_dimensions site config setting I assumed I had to enter it in
the config text file. Never realised it was done via admin. Cool!

- Simon

On Dec 10, 9:31 am, Konstantin Nikiforov <hellla...@gmail.com> wrote:
> I'm not used show_media filter before, but according to source code
> you need to:
>
> 1. Go to /admin/config
> 2. Press "make a new config setting" button
> 3. Module = site,
>    Key    = media_dimensions,
>    Value  = 101x101,201x201,301x301
> 4. And press ok button.
>
> Please try this, but i'm not sure that it will work 100%.
>
> В Fri, 9 Dec 2011 12:08:38 -0800 (PST)

> Simon Smithies <simon.smith...@gmail.com> пишет:

>  signature.asc
> < 1KViewDownload

Konstantin Nikiforov

unread,
Dec 10, 2011, 3:30:05 AM12/10/11
to zotoni...@googlegroups.com
So, may be just to use image tag?

{% image ... width=x height=y %}


В Fri, 9 Dec 2011 13:44:48 -0800 (PST)
Simon Smithies <simon.s...@gmail.com> пишет:

> I'm afraid that's had no effect.

signature.asc

Arjan Scherpenisse

unread,
Dec 10, 2011, 5:49:07 AM12/10/11
to zotoni...@googlegroups.com
The media dimensions are only used for inline images in the body text of
an rsc which are expanded with the |show_media filter.

cheers Arjan

Simon Smithies

unread,
Dec 10, 2011, 10:45:29 PM12/10/11
to zotoni...@googlegroups.com
This image was inserted inline in the body text. Or at least I think so ... It was inserted using the insert image button in the tinymce editor -- is that what you mean?

So to me at least, it sounds like it should be picking up those dimensions ... Or at least the default ones if not my overrides. Thinking perhaps I need to add the show_media filter to my template. Will try it when I get to a computer (unless someone tells me I'm barking up the wrong tree).

- Simon

Simon Smithies

unread,
Dec 10, 2011, 11:27:32 PM12/10/11
to Zotonic users
Just had a look. The template already includes the show_media filter:
{{ m.rsc.sidebar_offers.body|show_media }}

So there goes that theory.

It's an "included" template -- included in my "content" template
(which extends "base.tpl"). Nothing unconventional here I would
say ... but maybe I need to do something else to get show_media to do
the right thing when it's called from this level. Guessing now ...

- Simon.

On Dec 11, 4:45 pm, Simon Smithies <simon.smith...@gmail.com> wrote:
> This image was inserted inline in the body text. Or at least I think so ... It was inserted using the insert image button in the tinymce editor -- is that what you mean?
>
> So to me at least, it sounds like it should be picking up those dimensions ... Or at least the default ones if not my overrides. Thinking perhaps I need to add the show_media filter to my template. Will try it when I get to a computer (unless someone tells me I'm barking up the wrong tree).
>
> - Simon
>
> On 10/12/2011, at 11:49 PM, Arjan Scherpenisse <ar...@scherpenisse.net> wrote:
>
>
>
>
>
>
>
> > The media dimensions are only used for inline images in the body text of
> > an rsc which are expanded with the |show_media filter.
>
> > cheers Arjan
>
> > On 12/10/2011 09:30 AM, Konstantin Nikiforov wrote:
> >> So, may be just to use image tag?
>
> >> {% image ... width=x height=y %}
>
> >> В Fri, 9 Dec 2011 13:44:48 -0800 (PST)

> >> Simon Smithies <simon.smith...@gmail.com> пишет:

Arjan Scherpenisse

unread,
Dec 11, 2011, 3:29:24 AM12/11/11
to zotoni...@googlegroups.com
You're right Simon, when inlining images in the body text it should
respect the settings in media_dimensions.

I'll have a quick try to reproduce it...

Arjan

Simon Smithies

unread,
Dec 14, 2011, 12:59:34 AM12/14/11
to Zotonic users
Hi Arjan,

Any progress repro'ing my media_dimensions issue? Is there anything I
can do/info I can provide to help?

I'm still seeing the problem ...

- Simon

Reply all
Reply to author
Forward
0 new messages