We currently have an issue where some users are linking to images on Imgur in their statuses and these images are monstrously huge. Is there a way to automatically resize how they're displayed on the forum?
You may use @AndyB 's add-on 'Convert image' that automatically converts all URL linked images to attachment which you can control the size in Attachment options in ACP.
Try this in extra.lessIs there a way to automatically resize how they're displayed on the forum?
.bbImage
{max-width:300px}
https://i.imgur.com/Fj0iyPL.png, you can basically just rename the file to https://i.imgur.com/Fj0iyPLh.png (added h at the end of file name). you can also replace png with jpg to further reduce the file size. i imagine one can create a regex powered file and replace command that could potentially rename all imgur image links to smaller sized versions. that part is out of my expertise.above code is pretty useful but would not reduce the download size of the hotlinked image![]()
Is there a way to automatically resize how they're displayed on the forum?
Try this in extra.less
Code:.bbImage {max-width:300px}
where exactly in extra.less do i put this code?This worked like a charm. Thank you!
Anywhere you like as long as you don't break any other code that is in there. If in doubt put it at the top or the bottom.where exactly in extra.less do i put this code?
yeah, added the code at the bottom, but it didnt resize the the url img i posted.Anywhere you like as long as you don't break any other code that is in there. If in doubt put it at the top or the bottom.
Can you post a URL so we can see what is going wrong?yeah, added the code at the bottom, but it didnt resize the the url img i posted.
I think it may be due to the fact that im on XF 2.2, not 2.1 , https://www.clubfsport.com/threads/...-rohana-rfc10-rims-how-does-it-look.4/#post-4Can you post a URL so we can see what is going wrong?
.bbImage {
max-width: 400px;
max-height: 600px;
object-fit: contain;
border: solid 1px #bbb;
padding: 4px;
}
worked like a charm. Thank you.I am using this and it works great on 2.2.
CSS:.bbImage { max-width: 400px; max-height: 600px; object-fit: contain; border: solid 1px #bbb; padding: 4px; }
do make sure you are modifying the extra.less file in the style you are checking on. you can have different files for different themes.
I believe that will affect all images everywhere whether attached or hot linked. I may be wrong but I would check.worked like a charm. Thank you.
[data-url="https://URL_OF_IMAGE.jpg"]
{width:200px;height:100px}
We use essential cookies to make this site work, and optional cookies to enhance your experience.