Forums / Install & configuration / Image size problem in 3.9

Image size problem in 3.9

Author Message

Laurent Patenotre

Thursday 21 December 2006 4:24:07 am

I have update my test site from 3.8.6 to 3.9.

I have a problem with all the image. I can't modify the size. All the image take a default size (300px)
On the version 3.8.6 and before it was OK, not whith the new one

Have you an idea?

Thanks

Laurent

Claudia Kosny

Thursday 21 December 2006 11:06:16 am

Hi Laurent

Do you get any error messages in the debug output? My first guess would be that your image.ini did not survive the update which should result in some error messages.

Claudia

Laurent Patenotre

Friday 22 December 2006 1:06:14 am

Hi Claudia,

No I have any error message in the debug output.

I am agree with you: it seems to be a problem with an image.tpl. I have remove my overwrite tpl and use only the default. And the problem stay on.

There is a big difference between 3.8.x and 3.9 concerning the image?

Claudia Kosny

Friday 29 December 2006 4:30:08 pm

Hi Laurent

I did not mean the template but the image.ini file, although checking the template is a good idea as well. But I think you should have gotten some error messages if there is something wrong with the image.ini so it looks like this is not the problem.

This means I need a bit more information:
What exactly do you mean by 'I can't modify the size' ? Do you use attribute_view_gui for an class attribute of type image or do you embed images using the online editor or ... to display the images? And is the default size of 300px of your images the size they were uploaded in or is it something set by EZ?

Claudia

Laurent Patenotre

Wednesday 03 January 2007 6:09:01 am

Hello Claudia and Happy new years!

I am trying to give you more information.

For example, when I edit a folder, I would like to insert in the short description area an image. This image must be embedded with small size propriety.

With the 3.9 version this size is ignored !

I think I have a problem with my custumized template. The small size is ok when I open this contents in admin mode.

I don't where is this error!

Reagerds

Mike Machnik

Wednesday 03 January 2007 1:52:37 pm

I have observed what I think is the same problem. I disabled the Online Editor to make sure that was not the issue. If I use an embed tag in an XML block as follows:

<embed size="small" href="ezobject://177" />

Then in the admin interface I see the smaller version of the image. But on the site itself, the large version is always what I get, no matter what I put for the size (original, small, etc.).

I have cleared the cache, no difference. It is definitely rebuilding the page with the large version of the image, the page source confirms this.

Is there an ini setting I am overlooking, or is this a bug? Thanks...

(edit) By the way, this is not an ezwebin issue -- I am not using the new web interface for this site.

Andreas Kaiser

Thursday 04 January 2007 12:19:47 pm

I had the same problem, but with a new install of 3.9. In my case I saw the correct size of the image in the admin area, but in the public section allways the large image and alligment didn't worked...

I changed the code in "design/base/override/templates/embed/image.tpl" with the one of "design/admin/override/templates/embed_image.tpl" (I think it also could be done with an override...).

I think the solution should be other, but it works...

design/base/override/templates/embed/image.tpl

<div class="content-view-embeddedmedia">
<div class="class-image">

<div class="attribute-image">
<p>
{section show=is_set($link_parameters.href)}
  {section show=is_set($link_parameters.size)}
    {attribute_view_gui attribute=$object.data_map.image image_class=$object_parameters.size href=$link_parameters.href|ezurl target=$link_parameters.target link_class=$link_parameters.classification link_id=$link_parameters.id}
  {section-else}
    {attribute_view_gui attribute=$object.data_map.image href=$link_parameters.href|ezurl target=$link_parameters.target link_class=$link_parameters.classification link_id=$link_parameters.id}
  {/section}
{section-else}
  {section show=is_set($link_parameters.size)}
    {attribute_view_gui attribute=$object.data_map.image image_class=$object_parameters.size}
  {section-else}
    {attribute_view_gui attribute=$object.data_map.image}
  {/section}
{/section}
</p>
</div>

{section show=$object.data_map.caption.has_content}
{section show=is_set($object.data_map.image.content[$object_parameters.size].width)}
<div class="attribute-caption" style="width: {$object.data_map.image.content[$object_parameters.size].width}px">
{section-else}
<div class="attribute-caption">
{/section}
    {attribute_view_gui attribute=$object.data_map.caption}
</div>
{/section}
</div>
</div>

design/admin/override/templates/embed_image.tpl

{default $object_parameters=array()}
{let image_variation="false"
     align="center"
     attribute_parameters=$object_parameters}
{section show=is_set($attribute_parameters.size)}
{set image_variation=$object.data_map.image.content[$attribute_parameters.size]}
{section-else}
{set image_variation=$object.data_map.image.content[ezini( 'ImageSettings', 'DefaultEmbedAlias', 'content.ini' )]}
{/section}
{section show=is_set($attribute_parameters.align)}
{set align=$attribute_parameters.align}
{section-else}
{set align="center"}
{/section}

<div class="image{$align}">
{section show=is_set($link_parameters.href)}<a href={$link_parameters.href|ezurl} target="{$link_parameters.target}">{/section}
<img src={$image_variation.full_path|ezroot} alt="{$object.data_map.image.content.alternative_text|wash(xhtml)}" />
{section show=is_set($link_parameters.href)}</a>{/section}

<div style="width: {$image_variation.width}px;">
{$object.data_map.caption.content.output.output_text}
</div>
</div>

{/let}

eZ Partner in Madrid (Spain)
Web: http://www.atela.net/

Claudia Kosny

Thursday 04 January 2007 12:36:37 pm

Hello Laurent and Mike

Having images in different sizes within an XML block works fine for me, so I cannot help you directly with with this problem. Here some tips on how to pinpoint the reason for the problem:

Enable debug output and display the list of used templates. Clear all caches and display the page again. It would be a good idea to create a test object for this which just contains an image in an XML block, no text or other stuff. On the bottom of the page you will now see a list of the templates that were used to display the page. Note that if you reload the page, this list will not contain all templates, as most templates are usually cached.

In the list there should be a line for embed/image.tpl or embed-inline/image.tpl (depending on how you inserted the picture), which also shows where the templates are located. Open the template files. In both templates there should be a variable $object_parameters available, which holds amongst other data the size of the picture to display. To check whether the variable is there, type {$object_parameters|attribute('show', 2)} at the beginning of each template, save the template, clear the cache and display the page again. Now you should see a small table with the content of the variable $object_parameters somewhere in the vicinity of your picture, which should mention the desired size of the picture.

If the size is there and correct, there must either a typo on this template or in the template that is used for the attribute_view_gui for the picture (you can see the path of this template in the list mentioned above as well). So check the code there.

If the size is not there, check the templates for content/datatype/view/ezxmltags/embed.tpl or content/datatype/view/ezxmltags/embed-inline.tpl as these template are calling up the image templates mentioned above. Check again whether the variable $object_parameters is there. If it is there, make sure it is transferred correctly to the content_view_gui function. (You will see what I mean when you see the template code).

If the variable object_parameters is not there, something seems to be wrong with the output handler which is way beyong my knowledge.

Good luck

Claudia

Andreas Kaiser

Thursday 04 January 2007 4:14:26 pm

Hello Claudia,

I will try your recommendations: "check whether the variable is there, type {$object_parameters|attribute('show', 2)} at the beginning of each template,"

I want to investigate this, because I don't like my patch...

eZ Partner in Madrid (Spain)
Web: http://www.atela.net/

Andreas Kaiser

Thursday 04 January 2007 4:28:00 pm

Hello Claudia,

just added "{$object_parameters|attribute('show', 2)}" to test the original design/base/override/templates/embed/image.tpl.

I get following text:

Attribute 	Type 	Value
size 	string 	'original'
align 	string 	'right'

These are the attributes I have configured in the admin area, but in the public site I get the large image without format (image not aligned).

I don't get any error in the debug, and like I said when I change the code of "design/base/override/templates/embed/image.tplĀ· with the one of the "design/admin/override/templates/embed_image.tpl" the correct size and alligment is shown...

eZ Partner in Madrid (Spain)
Web: http://www.atela.net/

Claudia Kosny

Friday 05 January 2007 3:07:27 pm

Hi Andreas

So you say you want to have the original picture, but you get the large picture instead? You can see that easily in the name of the picture, as eZ appends the name of the imagealias (in this case 'large') If that is the case something goes wrong with the image handler, where I can't help you at all, sorry.

The alignment is just done by the class of the div in the template embed.tpl. So have a look at the HTML code that is produced by the templates and check whether there is a div around the picture. There are actually several divs, but one should have a class that starts with "object-right... . If this is there, your CSS is wrong. If it is not there, check the embed.tpl.

The template design/base/override/templates/embed/image.tpl which you posted in your previous post is not used on my system (3.9, ezwebin), so I just glanced over the code. To me it looks like there is an error because they always check for $link_parameters.size which should be $object_parameters.size instead. But as I have not checked this template, using link_parameters.size might be perfectly fine, I don't know. But this could account for the fact that the wrong size is used.The alignment is done again via CSS and the admin template uses a different class, so maybe the CSS for whatever class the base design is using for alignment is not there.

Good luck

Claudia

neil clark

Thursday 11 January 2007 7:56:33 am

Just to note I/we also have this problem so any further advice would be appreciated.

Harry van Irsel

Wednesday 24 January 2007 11:58:36 pm

I have updated my site from 3.8.6 to 3.9 and I get the same problem with the images.
All the image take a default size (300px)
On the version 3.8.6 and before it was OK.

Harry van Irsel

Friday 26 January 2007 1:29:37 am

I did about the same as Andreas did.

I copied the code from design/admin/override/templates/embed_image.tpl to
design/my_site/override/templates/embed/image.tpl

After that it works.......

Kirill Subbotin

Friday 26 January 2007 7:09:33 am

Seems like it is connected with a bug http://issues.ez.no/9940
Then it is already fixed.

Harry van Irsel

Saturday 27 January 2007 12:00:55 am

Removed the override and applied the bugfix. That works!

Thanks for your reply.