We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

plugin: Image Sizer

Development and Programming

steve-o-lution's avatar
steve-o-lution
52 posts
16 years ago
steve-o-lution's avatar steve-o-lution

I have a question about the Image Resizer plugin. Is it possible to resize a picture, but not to made a cut off from it. So that only the original picture will appear but only smaller?

       
Micky's avatar
Micky
4 posts
16 years ago
Micky's avatar Micky

(I am having problems posting a reply with my other account… Strange.)

Whoa, I think I solved my problem…

I forgot to mention, I am using MH File plugin to upload images…

Changing the imagesizer call to this seems to fixed my problems:

{exp:imgsizer:size src="/mm/images/uploads/{image-02}{file_name}{/image-02}" auto="586"}

The MH File plugin was returning the absolute URL to the image… The above is root relative and that appears to have fixed my problems.

       
Micky's avatar
Micky
4 posts
16 years ago
Micky's avatar Micky

Having problems posting a reply…

{exp:imgsizer:size src="/mm/images/uploads/{image-02}{file_name}{/image-02}" auto="586"}

The MH File plugin was returning the absolute URL to the image… The above is root relative and that appears to have fixed my problems.

       
mhulse's avatar
mhulse
329 posts
16 years ago
mhulse's avatar mhulse

@Steve: I think that it does this by default??? I use the plugin myself and it does not crop, it just resizes to the size I want. 😊

@Anyone: I fixed my own problem, see post above ^^^^^^

I was giving the plugin an absolute path to image, instead of a root relative path.

       
noregt's avatar
noregt
360 posts
16 years ago
noregt's avatar noregt

I’m having the same issue as Steve. Running a brand new version of EE and the plugin, but it appears to crop whether I like it or not. With this super simple script

{exp:imgsizer:size image={bestand} height="246" width="300"}

The width is scaled, but height of the image is cropped.

Is it the plugin or is it me?

       
mhulse's avatar
mhulse
329 posts
16 years ago
mhulse's avatar mhulse
{exp:imgsizer:size image={bestand} height="246" width="300"}

Crapshoot… What happens when you put quotes around “{bestand}”?

Probably will not make a difference, but you never know. 😊

       
noregt's avatar
noregt
360 posts
16 years ago
noregt's avatar noregt

mhulse,

Thanks for the help. It sort of solves the problem in a very brutal way, the images are not displayed at all anymore. 😖

I think there’s something wrong with the crop future. Tried to hack it out of the plugin, but it’s a bit more complicated then I thought.

       
ImpGabe's avatar
ImpGabe
171 posts
16 years ago
ImpGabe's avatar ImpGabe

With Image Sizer to resize but not crop, define either width or height and leave the other blank.

       
noregt's avatar
noregt
360 posts
16 years ago
noregt's avatar noregt

Nope, still cropping! See attachment. Images are not resized at all now but only cropped.

       
ImpGabe's avatar
ImpGabe
171 posts
16 years ago
ImpGabe's avatar ImpGabe

Two things to check. First make sure you don’t have a width or height applied to the img tag in your css. Second, are you setting the correct attribute? For instance, did you set the width in that example? If so, it will set the images to 300px and keep them proportional as far as height is concerned. If these two things are not the issue then what version of EE are you using? There could be a conflict that I’m not aware of. I haven’t used the Image Sizer in 1.6.7, but everything up to 1.6.6 should be fine.

Also, can you repost the new code?

       
noregt's avatar
noregt
360 posts
16 years ago
noregt's avatar noregt
Two things to check. First make sure you don’t have a width or height applied to the img tag in your css.

Removed the img tag height and width, no difference

Second, are you setting the correct attribute? For instance, did you set the width in that example? If so, it will set the images to 300px and keep them proportional as far as height is concerned.

Still the same basic script

{exp:imgsizer:size image={bestand} height="246" width="300"}
If these two things are not the issue then what version of EE are you using? There could be a conflict that I’m not aware of. I haven’t used the Image Sizer in 1.6.7, but everything up to 1.6.6 should be fine.

I’m using a brand new install 1.6.7 here with the latest plugin

       
ImpGabe's avatar
ImpGabe
171 posts
16 years ago
ImpGabe's avatar ImpGabe

do this

{exp:imgsizer:size image={bestand} height="246"}

Also, any img width and heights you set in your css will affect the outcome. It’s best to contain the image in a div and set that width and height and let image sizer do it’s thing to the image.

So for instance if you wanted the image to take up a certain amount of space you would do this.

<div class="image_box">
{exp:imgsizer:size image={bestand} height="246"}
</div>

then your css would look like this:

.image_box {
width:300px;
height:246px;
text-align:center; /* this should center the image in the area. you can use other methods if you like */
}

Keep in mind this is a basic landscape orientation method. If you have images that are a lot wider than they are taller, you might have to start with the width setting for the image sizer and work from there in the css. Of course you can always just define a padding and leave off the width and height in the css. But if your container (column, div, etc) needs to be a certain width or height then that’s the attribute you should use for image sizer.

       
noregt's avatar
noregt
360 posts
16 years ago
noregt's avatar noregt

PS; i did use imgsizer before without any issues on 1.6.3. and that worked just fine.

With this setting: height=”246” width=”300”

imgsizer produces this image: Foto_Frans2-300x246.JPG

It should be either be 300 x autoheight(app. 500px) or autowidth (app 200) x 246.

Also tried it in an empty template, still the same effect.

EDIT: the point is not so much that the size isn’t right, because it is, the point is that it cuts off part of the image.

       
ImpGabe's avatar
ImpGabe
171 posts
16 years ago
ImpGabe's avatar ImpGabe

If you assign both a width and a height in Image Sizer it will scale down as close as possible and then crop it to that size.

I guess I’m confused as to what you’re trying to do with the images in your layout. It seems like you have 2 totally different sizes you want to use.

       
ImpGabe's avatar
ImpGabe
171 posts
16 years ago
ImpGabe's avatar ImpGabe

Also, one thing that might be confusing is that the usage for using the Tag Pair is different than for using the Single Tag. So in the usage instructions it says that if you define both width and height, width will take precedence. But this is if you use the Tag Pair and not the single tag.

       
First 22 23 24 25 26 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.