Plugin

Archived
Forum
(read-only)

CE Image

ExpressionEngine 1.x, ExpressionEngine 2, ExpressionEngine 3

Back to this add-on's main page
View Other Add-ons From Causing Effect

     

Some remote image not rendering even though the paths are correct

Support (Resolved)

Jim Pannell
Jim Pannell

Hi Aaron

I’m running EE 1.6.8 (crazy I know!) and am having a strange issue whereby some external images that CE Image is resizing aren’t being rendered at all (there’s just no output at all). I’m not sure of the percentage, but it looks like less than 10 - still unacceptable to my client though.

I’ve turned template debugging on but in 1.6.8 I don’t get anything useful really. Here’s the debug output of an image that didn’t output anything:

(1.292416Tag{exp:ce_img:pair src="http://www.alps-luxury.com/photos/1392_008.jpg" width="133" height="100" fallback_src="/images/fallback-image.png" cache="yes" refresh="360"

If you try this image in your browser, you’ll see that it works. If there was something wrong with the image I’d expect to see the fallback image instead, but that doesn’t even show. I get zilch output apart from what’s in the debugger.

To give you a little more info, this is in a real estate property search results page using Solspace Super Search. Other images from the same domain (alps-luxury.com) are being shown before and after the blanks.

Again, this is an external (remote) image rather than a local one.

Any help would be really appreciated.


Jim

Causing Effect - Aaron Waldon
# 1
Developer
Causing Effect - Aaron Waldon

Hi Jim!

Sometimes the images fail the XSS check that is enabled by default. If you trust the source of the remote images (which it sounds like you do), you can use the disable_xss_check=“yes” parameter to turn it off.

Please let me know how that goes! ;)

Jim Pannell
# 2
Jim Pannell

That fixed it! Wonderful!!!

Thanks a million Aaron. How did we possibly survive before you arrived on the scene?

Causing Effect - Aaron Waldon
# 3
Developer
Causing Effect - Aaron Waldon

Hahaha, glad to hear it Jim! I’m actually surprised you don’t hate me by now; helping you with Amazon S3 is currently the oldest item on my todo list…

Jim Pannell
# 4
Jim Pannell

Not at all Aaron. I’ve kind of given up on that one to be honest, figuring that it might have been not possible with my EE 1.6.8 install. However, I’ve just spent the last week moving it to a new server where I have 100% control. Perhaps there were some php modules that weren’t installed that I needed…

Jim Pannell
# 5
Jim Pannell

Hey Aaron

Me again I’m afraid. Same site, same problem although this time disable_xss_check isn’t helping at all.

It’s a remote image so anything should be able to get it working in theory. Can you perhaps try this?

{exp:ce_img:pair src="http://image-repository.my-french-house.com/properties/20/2010/05/11/05.jpg" width="462" height="312"}<img src="{made}" alt="" />{/exp:ce_img:pair} 

I get no output at all and nothing in template debugging to suggest a problem.

Cheers


Jim

Causing Effect - Aaron Waldon
# 6
Developer
Causing Effect - Aaron Waldon

Hi Jim!

I first tried your code and it didn’t work (it actually threw an error, which looks like a regex problem with the CodeIgniter core XSS filter when filtering something with numbers?). I then added:

disable_xss_check="yes" 

to the tag, and now I see a picture of beautiful house with a pool on the side of a hill overlooking the ocean…

I get no output at all and nothing in template debugging to suggest a problem.

What does template debugging say about that image? Nothing at all?

Jim Pannell
# 7
Jim Pannell

Hi Aaron

The thing is, I still get no output when I use the xss filter tag. I’m on 1.6.8 so there’s no error information in the template debugging output.

Bit stumpted with this…


Jim

Causing Effect - Aaron Waldon
# 8
Developer
Causing Effect - Aaron Waldon

I’m on 1.6.8 so there’s no error information in the template debugging output.

There should be. You have to be logged into the site in question as a super admin, and have template debugging enabled.

You may also try and clear your cached files in your ‘remote’ folder, at least for the domain of the remote image.

Jim Pannell
# 9
Jim Pannell

Here’s the debugging output I’m getting from the following template code:

{exp:ce_img:pair src="http://image-repository.my-french-house.com/properties/20/2010/05/11/05.jpg" disable_xss_check="yes"  width="462" height="312"}<img src="{made}" alt="" />{/exp:ce_img:pair} 

Note that this is being run on http://www.my-french-house.com and that image-repository is actually a subdirectory of the root of http://www.my-french-house.com (there are only a few images using this sub domain - I realise it will slow things down with CE Image).

Debugging output:

(0.008104Tag{exp:ce_img:pair src="http:&#47;&#47;image-repository.my-french-house.com&#47;properties&#47;20&#47;2010&#47;05&#47;11&#47;05.jpg" disable_xss_check="yes" width="462" height="312"}
(0.008263Closing Tag Found
(0.008314Processing Tags
(0.008341Plugin TagCe_img/pair
(0.008355Including Files for Tag and Modules
(0.008744Beginning Final Tag Data Processing
(0.008763Calling Class/MethodCe_img/pair
(0.008877) -> Class CalledCe_img
(0.008904) -> Method Calledpair
(0.012959Returning No Results Content
(0.012995) -> Data Returned
(0.013032) - End Tag Processing 

‘Returning no results content’ doesn’t sound too positive.

Any ideas?

Cheers

Jim

Jim Pannell
# 10
Jim Pannell

UPDATE: If I change the URL to http://www.my-french-house.com/image-repository/properties/20/2010/05/11/05.jpg it works, so it’s because of the sub domain that it’s not working.

Causing Effect - Aaron Waldon
# 11
Developer
Causing Effect - Aaron Waldon

‘Returning no results content’ doesn’t sound too positive.

To find out why, you need to find the debug info that starts with “*** CE Image debug:”. It should look something like:

(0.026034 6.16MBCalling Class/MethodCe_img/single
(0.026140 6.16MB) -> Class CalledCe_img
(0.026170 6.16MB) -> Method Calledsingle
(0.038385 7.17MB)   ***  CE Image debugBase path'/your/current/document/root/'
(0.038408 7.17MB)   ***  CE Image debugSource image'images/example/not_real.jpg'Fallback image''
(0.038429 7.17MB)   ***  CE Image debugSource image is not readable or does not exist'images/example/not_real.jpg'.
(
0.038442 7.17MB)   ***  CE Image debugFallback source image is not readable or does not exist''.
(
0.038471 7.17MBReturning No Results Content
(0.038555 7.16MB) -> Data Returned 

UPDATE: If I change the URL to http://www.my-french-house.com/image-repository/properties/20/2010/05/11/05.jpg it works, so it’s because of the sub domain that it’s not working.

I don’t get it. The image is not at ‘http://www.my-french-house.com/properties/20/2010/05/11/05.jpg’, it is at ‘http://image-repository.my-french-house.com/properties/20/2010/05/11/05.jpg’, right?

Are you using the $conf[‘ce_image_src_regex’] (it should say so if you are in the debug info). If not, you should be able to add something along these lines to your config (which will also make it faster and use up less server space, as you are not having to redownload the image to your server using cURL):

$conf['ce_image_src_regex'= array( 'http://image-repository.my-french-house.com/' => '/server/path/to/image-repository/web_root/goes/here/' ); 
Jim Pannell
# 12
Jim Pannell

http://image-repository.my-french-house.com actually points to http://www.my-french-house.com/image-repository, so both locations share the same base path.

Doing a search on http://image-repository.my-french-house.com and replacing it with http://www.my-french-house.com/image-repository totally fixed the problem.

Still not 100% sure why… Also, on 1.6.8 I never get anything like “*** CE Image debug:” in the debugging output.