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

Jony's avatar
Jony
8 posts
16 years ago
Jony's avatar Jony

Hi lumis, I hope you can help me.

I have installed your plugin and put the tags inside my template and I’m not getting any errors, but the tags does not work at all.

The problem seems to be a missing path because the tag is not showing anything. But I´ve tried to put strict url and relative url to the image, and both ends with the same result.

I can’t see what’s the problem.

Thanks in advance.

       
lumis's avatar
lumis
119 posts
16 years ago
lumis's avatar lumis

Jony Try turning on template debugging in the EE CP. That will show any errors

       
florian's avatar
florian
395 posts
16 years ago
florian's avatar florian

Hi,

I am having problems with the image sizer plugin. For some reason I can not get it to display my images.

1.) I use the file extension for image upload and a custom field. 2.) I created the cache folder (images/uploads/cache) and made it writable (777) 3.) I uploaded a php script to test if GD is available and it is. 4.) For testing purpose I am using a blank template with only the image sizer tag. Here is the code.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>

{exp:weblog:entries weblog="tapes"}    
   
{exp:imgsizer:size src="{item_photo}" }

{/exp:weblog:entries}

</body>
</html>

For testing purpose and eliminating erros I tried the following code:

{exp:weblog:entries weblog="tapes"}      
{item_photo}
{/exp:weblog:entries}

-> With this code, the image displays correctly. So the file extension and the ee weblog stuff works.

I am using the same code for the image sizer which works for two other projects. Also, I am using the same version plugin.

I already tried the new version but it didnt make a difference.

My last resort was to turn on template debugging. Below are the results. Does anybody see what the issue could be??

-> I am using ExpressionEngine v 1.6.7 and the Plugin is v.2.1.2

here is the debugging result: (for (0.050180) img src, I changed the IP address for privacy reasons.. BUT in the original output, the correct img url is displayed)

TEMPLATE DEBUGGING
--------------------------------------------------------------------------------

(0.000041) - Begin Template Processing - 
(0.000353) URI: /marking_tapes/test/
(0.000383) Path.php Template: /
(0.000420) Retrieving Template
(0.000454) Parsing Template URI
(0.004957) Retrieving Template from Database: marking_tapes/test
(0.007540) Template Found
(0.013439) Template Type: webpage
(0.013708) Parsing Site Variables
(0.013806) Global Path.php Variables (Keys): site_id|site_label|site_short_name
(0.013840) Global Path.php Variables (Values): 1|Bourne Signs|default_site
(0.013985) Parse Date Format String Constants
(0.014026) Parse Current Time Variables
(0.014088) Parsing Segment, Embed, and Global Vars Conditionals
(0.014596) - Beginning Tag Processing - 
(0.014636) Parsing Tags in Template
(0.014689) Tag: {exp:weblog:entries weblog="tapes"}
(0.014862) Closing Tag Found
(0.014988) Processing Tags
(0.015038) Module Tag: Weblog/entries
(0.015075) Including Files for Tag and Modules
(0.024413) Beginning Final Tag Data Processing
(0.024466) Calling Class/Method: Weblog/entries
(0.024765) -> Class Called: Weblog
(0.024952) -> Method Called: entries
(0.044051) Calling Extension Class/Method: Mh_file_ext/modify_template
(0.049896) -> Data Returned
(0.050121) Parsing Tags in Template
(0.050180) Tag: {exp:imgsizer:size src="http://11.22.78.120/~bgroup/images/uploads/tape_black-yellow.gif" }
(0.050355) No Closing Tag
(0.050507) Processing Tags
(0.050565) Plugin Tag: Imgsizer/size
(0.050598) Including Files for Tag and Modules
(0.051630) Beginning Final Tag Data Processing
(0.051670) Calling Class/Method: Imgsizer/size
(0.051826) -> Class Called: Imgsizer
(0.051867) -> Method Called: size
(0.052243) Returning No Results Content
(0.052283) -> Data Returned
(0.052349) - End Tag Processing - 
(0.052442) - End Template Processing - 
(0.052467) Parse Global Variables
(0.055763) Template Parsing Finished
       
dalio's avatar
dalio
11 posts
16 years ago
dalio's avatar dalio

Florian,

You might want to try closing the image sizer tag, so you have:

{exp:imgsizer:size src="{item_photo}"}{/exp:imgsizer:size}

I had problems with this before and it seemed to fix it for me.

L

       
florian's avatar
florian
395 posts
16 years ago
florian's avatar florian

I did try closing it but same result. I thought that when using the opening and closing tag I had to use the parameters in the middle like “sizer” “src” etc. I tried both the single and the paired tag but its not working. I must be missing something else! Any other ideas?

Would it be correct to assume that the following line from the debugger is the problem:

(0.052243) Returning No Results Content

I have no experience with the debugger so not sure what all the lines mean.

       
Hop Studios's avatar
Hop Studios
459 posts
16 years ago
Hop Studios's avatar Hop Studios

I’m using 2.5.5 and I’m having a problem with the “width” parameter. {report_featured_graphic} is 399 pixels wide by 298 tall.

{exp:imgsizer:size src="{report_featured_graphic}” width=”60” alt=”{title}”}

This creates an image that’s 60 pixels wide, but is still just as tall as the original image – i.e. 298 pixels tall.

I though it was supposed to scale it proportionally…

TTFN Travis

       
lumis's avatar
lumis
119 posts
16 years ago
lumis's avatar lumis

@florian
try upgrading to 2.5.5 version 2.1.2 does not have template debugging

@Travis it is supposed to scale proportionality.. do you have any css styling on that image can you turn on template debugging and post anything with imgsizer in front of it. also what is the output of {report_featured_graphic} in the template without passing it into imagesizer?

       
florian's avatar
florian
395 posts
16 years ago
florian's avatar florian
  • I updated to the new version and turned on template debugging.
  • My guess is that my issue is with the base path.

test 1:)

Basic setup in the template

<body>

{exp:weblog:entries weblog="tapes" sort="desc" limit="1" disable="member_data|pagination|trackbacks"}
{exp:imgsizer:size src="{tape_photo}" height="103"}
{/exp:weblog:entries}

</body>

the debugging output

(0.129171) Calling Extension Class/Method: Mh_file_ext/modify_template
(0.135337) -> Data Returned
(0.135608) Parsing Tags in Template
(0.135671) Tag: {exp:imgsizer:size src="http://11.11.11.121/~bgroup/images/uploads/tape_red-diagnol.gif" height="103"}
(0.135868) No Closing Tag
(0.135983) Processing Tags
(0.136042) Plugin Tag: Imgsizer/size
(0.136076) Including Files for Tag and Modules
(0.137631) Beginning Final Tag Data Processing
(0.137672) Calling Class/Method: Imgsizer/size
(0.137831) -> Class Called: Imgsizer
(0.137872) -> Method Called: size
(0.137970) imgsizer.user.src: <img src="http://11.11.11.121/~bgroup/images/uploads/tape_red-diagnol.gif" alt=""  />
(0.138127) imgsizer.img[src]: /~bgroup/images/uploads/tape_red-diagnol.gif
(0.138154) imgsizer.img[base_path]: /usr/local/apache/htdocs/
(0.138208) imgsizer.img_full_path: /usr/local/apache/htdocs/~bgroup/images/uploads/tape_red-diagnol.gif
(0.138266) imgsizer.Error: /usr/local/apache/htdocs/~bgroup/images/uploads/tape_red-diagnol.gif image is not readable or does not exist
(0.138313) Returning No Results Content
(0.138348) -> Data Returned
(0.138408) - End Tag Processing -
  • the “imgsizer.user.src” is correct and the image shows up when I copy that url in the browser
  • however, the base path does not seem correct. I am on a reseller host.

-> Does it matter if the dns for the domain does not yet point to this account? Hence I am using my main IP address and then “~reseller-account-name” to access the html pages through browser. My host said that the ~ in linux stands for home directory.

test 2:)

trying to set base cache and base path in the template. Trying to set base path as the main IP and base cache as my cache folder in the images directory for this reseller account.

<body>

{exp:weblog:entries weblog="tapes" sort="desc" limit="1" disable="member_data|pagination|trackbacks"}
{exp:imgsizer:size src="{tape_photo}" base_cache="/images/uploads/cache/" base_path="http://11.11.11.121" height="103"}
{/exp:weblog:entries}

</body>

the debugging output

(0.067954) Tag: {exp:imgsizer:size src="http://11.11.11.121/~bgroup/images/uploads/tape_red-diagnol.gif" base_cache="/images/uploads/cache/" base_path="http://11.11.11.121" height="103"}
(0.068225) No Closing Tag
(0.068345) Processing Tags
(0.068406) Plugin Tag: Imgsizer/size
(0.068443) Including Files for Tag and Modules
(0.069622) Beginning Final Tag Data Processing
(0.069662) Calling Class/Method: Imgsizer/size
(0.069832) -> Class Called: Imgsizer
(0.069874) -> Method Called: size
(0.069974) imgsizer.user.src: <img src="http://11.11.11.121/~bgroup/images/uploads/tape_red-diagnol.gif" alt=""  />
(0.070136) imgsizer.img[src]: /~bgroup/images/uploads/tape_red-diagnol.gif
(0.070163) imgsizer.img[base_path]: http://11.11.11.121
(0.070218) imgsizer.img_full_path: http://11.11.11.121/~bgroup/images/uploads/tape_red-diagnol.gif
(0.070278) imgsizer.Error: http://11.11.11.121/~bgroup/images/uploads/tape_red-diagnol.gif image is not readable or does not exist
(0.070327) Returning No Results Content
  • seems to be some issue with the two // characters in the http part? Other than that, the actual path looks correct.

  • I checked ftp after this test, and no images were created in the imagse/cache folder.

test 3.)

I tried all kinds of different combinations for the base_path but I was unable to figure out a correct solution.

I double checked in the ftp software that image folder is set to 777. Also the files in the image folder are set to 777. The cache directory does exist and same with the images. cache directory is also 777.

-> I am sure I am overlooking something. Does anybody have an idea? -> I used the same plugin with several different websites and it always worked without a problem. I am using the same methods so I am not sure what the issue is this time. (the only difference I can think of is the unresolved dns. I wont change the dns over untill project is completted. makes sense?) -> I attached a screenshot for my file upload settings.

       
Craig Allen's avatar
Craig Allen
135 posts
16 years ago
Craig Allen's avatar Craig Allen

I understand that I can user the Image Sizer plugin to dynamically resize images if the image paths and desired width are entered to weblog fields.

This works if for example you have your templates set up so that an image is placed in a predefined position on your page. You can get a little more flexibility if you have more then one text block and an image div that is floated within each of these.

However, I’d like to be able to let my users use TinyMCE and it’s image manager without the complications involved in the above solution.

So what I’d really like is for the Image Sizer to be somehow applied to the images that are embedded with TinyMCE, using the image width property as the Image Sizer width property.

Possible?

       
Danny T.'s avatar
Danny T.
426 posts
16 years ago
Danny T.'s avatar Danny T.
I understand that I can user the Image Sizer plugin to dynamically resize images if the image paths and desired width are entered to weblog fields. This works if for example you have your templates set up so that an image is placed in a predefined position on your page. You can get a little more flexibility if you have more then one text block and an image div that is floated within each of these. However, I’d like to be able to let my users use TinyMCE and it’s image manager without the complications involved in the above solution. So what I’d really like is for the Image Sizer to be somehow applied to the images that are embedded with TinyMCE, using the image width property as the Image Sizer width property. Possible?

Craig,

I’ve never tried this myself personally, but you might be able to work something out with this and the Find and Replace Plus plugin.

Alternatively, you can instruct your users to not upload images through TinyMCE and use LG Replace, which works EXACTLY the same as you would composing a note in Facebook, in which you have dedicated fields to upload your image, then you apply the tag that corresponds to that field into your subject body, such as , for example.

       
Craig Allen's avatar
Craig Allen
135 posts
16 years ago
Craig Allen's avatar Craig Allen

Hmmm,

That might work if ExpressionEngine will interpret the imgsize tags after they have been created using the lg_replace or replace_plus tags.

I’ll see how it goes and report back.

       
Danny T.'s avatar
Danny T.
426 posts
16 years ago
Danny T.'s avatar Danny T.

Craig,

I am quite certain that the LG Replace method will work as noted. I believe Masuga and others have gotten to work this way. =) Please do update us!

       
Craig Allen's avatar
Craig Allen
135 posts
16 years ago
Craig Allen's avatar Craig Allen

To get from

this/is/the/path.jpg

to

{exp:imgsizer:size width="300" src="this/is/the/path.jpg"}

and hence back to the HTML image tag with the resized image file …

I’ve tried the following without success

{exp:lg_replace:haystack needles="<img|.jpg">"}

    {exp:lg_replace:replacement needle="<img"}
{exp:imgsizer:size 
    {/exp:lg_replace:replacement}

    {exp:lg_replace:replacement needle=".jpg">"}
.jpg"}
    {/exp:lg_replace:replacement}

    {body_text}

{/exp:lg_replace:haystack}

I think that the use of “, / and } characters in the needle and replacement text is probably the problem. I thought that escaping them with backslashes might work, but no.

[edit] - this is an lg_replace problem, not an imgsizer problem, I’ll take it to that thread instead. Thanks

       
lumis's avatar
lumis
119 posts
16 years ago
lumis's avatar lumis

@florian the problem is that ~bgroup is not a real directory it is basically an alias to a directory. your solution for the fix is half correct what you need to do is use base_path=”” but point to the full path from server root to your document root wherever ~bgroup is on the server

something like this base_path=”/usr/local/apache/htdocs/bgroup/” then put the path from there in your src=”” so your tag would end up looking like this

{exp:imgsizer:size src="/images/uploads/tape_red-diagnol.gif"  base_path="/usr/local/apache/htdocs/bgroup/" height="103"}

that is assuming that your image is actually at this server path /usr/local/apache/htdocs/bgroup/images/uploads/tape_red-diagnol.gif

       
florian's avatar
florian
395 posts
16 years ago
florian's avatar florian

This is just an update to one of my previous posts for support with the image sizer plugin. My issue was resolved when I pointed the dns for the domain to my server. It did not work without having the domain point to the hosting account on the server. Maybe this will help somebody in the future 😊

       
First 29 30 31 32 33 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.