Breaks image if not in default file directory

Created on 3 July 2014, almost 10 years ago
Updated 3 December 2023, 7 months ago

If an image is used which is local to Drupal, but not in the default files directory (in particular is in the current theme directory) then the resized link is corrupted.

I put the following in a block in the page header <p><img alt="" src="/sites/all/themes/lac_D7/images/buynow.png" /> xxxx</p>
Works fine, though something (Resize Filter?) has added height and width attributes when sent to the browser.

If I add different size attributes in the source: <p><img alt="" src="/sites/all/themes/lac_D7/images/buynow.png" style="height:21px; width:40px"/> xxxx</p>, then the code sent to the browser is <img alt="" src="" style="height:21px; width:40px" width="40" height="21">
On a previous occasion it generated a src URL to somewhere in youtube.

If the original source of the image is in the files directory, it works fine.

NOTE: I don't mind too much it not working for these images, I can resize them manually if necessary, but it is a pain when it corrupts the link and one is left trying to find out why.

Thanks, Tony

πŸ› Bug report
Status

Needs work

Version

1.14

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.69.0 2024