Author Topic: [How to] Testing inline image attachments  (Read 13965 times)

0 Members and 1 Guest are viewing this topic.

Online IanBTopic starter

  • Super Contributor
  • ***
  • Posts: 11853
  • Country: us
[How to] Testing inline image attachments
« on: December 21, 2021, 06:15:43 pm »
I couldn't figure out how to do this, so I am experimenting here to maybe give an example of how to do it.

For instance, there should be an inline image displayed here:



And this text should follow the image.
« Last Edit: December 21, 2021, 06:24:47 pm by IanB »
 

Offline xrunner

  • Super Contributor
  • ***
  • Posts: 7511
  • Country: us
  • hp>Agilent>Keysight>???
Re: [How to] Testing inline image attachments
« Reply #1 on: December 21, 2021, 06:18:14 pm »
Right click the thumb and copy the link, then do this -

Code: [Select]
[img]https://www.eevblog.com/forum/news/(how-to)-testing-inline-image-attachments/?action=dlattach;attach=1355732;image[/img]

I told my friends I could teach them to be funny, but they all just laughed at me.
 

Online IanBTopic starter

  • Super Contributor
  • ***
  • Posts: 11853
  • Country: us
Re: [How to] Testing inline image attachments
« Reply #2 on: December 21, 2021, 06:20:52 pm »
Right click the thumb and copy the link, then do this -

I understand that's the workaround, but you have to do it in two steps.

I'm trying to figure out the apparent "correct" way based on the attachment dialog?
 

Offline xrunner

  • Super Contributor
  • ***
  • Posts: 7511
  • Country: us
  • hp>Agilent>Keysight>???
Re: [How to] Testing inline image attachments
« Reply #3 on: December 21, 2021, 06:22:09 pm »
Right click the thumb and copy the link, then do this -

I understand that's the workaround, but you have to do it in two steps.

I'm trying to figure out the apparent "correct" way based on the attachment dialog?

Yea but the problem is I don't think it works anymore, or at least not reliably.  :(
I told my friends I could teach them to be funny, but they all just laughed at me.
 

Online IanBTopic starter

  • Super Contributor
  • ***
  • Posts: 11853
  • Country: us
Re: [How to] Testing inline image attachments
« Reply #4 on: December 21, 2021, 06:26:25 pm »
Yea but the problem is I don't think it works anymore, or at least not reliably.  :(

Apparently not. The attached help information does not seem to work as described?
 

Offline DrG

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: us
Re: [How to] Testing inline image attachments
« Reply #5 on: December 21, 2021, 06:35:08 pm »
edit: That I think that the attachment  you included is no longer applicable. There was a thread about this as I recall. Basically, you can't get it to work as it once did - there was a reason that it had to be disabled as I think it was causing other problems. The only way to do it now has already been stated in this thread.
« Last Edit: December 21, 2021, 06:54:33 pm by DrG »
- Invest in science - it pays big dividends. -
 

Online IanBTopic starter

  • Super Contributor
  • ***
  • Posts: 11853
  • Country: us
Re: [How to] Testing inline image attachments
« Reply #6 on: December 21, 2021, 06:38:42 pm »
I don't recall that thread, but if so, I think the attachment options should be removed, as it is confusing the way things are.

Also, I notice this article, that seems to suggest a better, or more supported, way to do it?

https://custom.simplemachines.org/index.php?mod=3770
 

Offline xrunner

  • Super Contributor
  • ***
  • Posts: 7511
  • Country: us
  • hp>Agilent>Keysight>???
Re: [How to] Testing inline image attachments
« Reply #7 on: December 21, 2021, 06:40:33 pm »
I don't recall that thread, but if so, I think the attachment options should be removed, as it is confusing the way things are.

Also, I notice this article, that seems to suggest a better, or more supported, way to do it?

https://custom.simplemachines.org/index.php?mod=3770

Won't happen. I have asked before if we could have the function repaired and I got shot down in flames. It's too dangerous to try to fix or remove, I was told.
I told my friends I could teach them to be funny, but they all just laughed at me.
 

Offline DrG

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: us
Re: [How to] Testing inline image attachments
« Reply #8 on: December 21, 2021, 06:53:12 pm »
https://www.eevblog.com/forum/chat/attention-eevblog-admins-attachments-mixup/

That is the thread I recall, but there have been several.

The two-step solution does work.
- Invest in science - it pays big dividends. -
 

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 6820
  • Country: va
Re: [How to] Testing inline image attachments
« Reply #9 on: December 21, 2021, 10:04:07 pm »
Right click the thumb and copy the link, then do this -

Code: [Select]
[img]https://www.eevblog.com/forum/news/(how-to)-testing-inline-image-attachments/?action=dlattach;attach=1355732;image[/img]



But doing that places the full-size image in the text. Which negates the usefulness, in size (which means loading times) and space, of the BTL thumbnail.

Please don't encourage people to create massive pages of just hi-res images :(
 

Online Smokey

  • Super Contributor
  • ***
  • Posts: 2565
  • Country: us
  • Not An Expert
Re: [How to] Testing inline image attachments
« Reply #10 on: August 20, 2023, 11:17:36 pm »
Step by step (tedious 2+ stage process) to get inline images, and resize so they don't show up as huge in the post:

1) Write your post.   Wherever you want your inline images to be in the body of your post, click the "Insert Image" button.  That button is the far left option with the little mona-lisa icon, right below the BOLD icon.  This will add the image tags
Code: [Select]
[img][/img]   This is a placeholder for the next step and won't actually do anything yet.  Leave the tags empty.

2) Attach your images to your post using the "Attachments and other options" button at the bottom.  It doesn't matter what drop down option you pick, so probably just leave it as "End-of-post expandable thumbnail".  (Yes I know most of those options say Inline, but it doesn't work).

3) Post your post.  The images should be thumbnails at the bottom, with nothing inline yet. 

4) Edit your post .  Use the "Modify message" button on the right side of the post, with the little paper and pencil icon.

5) Copy Links.  For each of the thumbnail images at the bottom of the post, click them to expand them to full size.  Then right click and select "Copy Image Address".  Now go back into your post and paste the address into the image tags you added previously.  It will look something like this
Code: [Select]
[img]https://www.eevblog.com/forum/section/post/?action=dlattach;attach=1850335;image[/img]   You could click the "save" button and be done, but your inline images will be full size and potentially huge and obnoxious.  So be a good forum citizen and do the next step too:

6) Resize the images to fit the post:  For each image tag, manually set a width option.  Just change
Code: [Select]
[img] to
Code: [Select]
[img width=xxx] with xxx being the image width your want.  200 to 400 is usually a good size, but you may need to edit, save and check to see what it looks like.  Repeat until your images are a good size.

So the full example would be:
Code: [Select]
[img width=200]https://www.eevblog.com/forum/section/post/?action=dlattach;attach=1850335;image[/img]
Note:
As pointed out below, using the "width" modifier on the image tag still downloads the full size image when someone loads your post.  It's just resized in the browser.  So if you want to be a stellar forum citizen and get 5 gold stars for effort, you can resize your images first before you upload them to save bandwidth.
« Last Edit: August 22, 2023, 05:02:54 am by Smokey »
 
The following users thanked this post: edavid, T3sl4co1l

Offline abeyer

  • Frequent Contributor
  • **
  • Posts: 287
  • Country: us
Re: [How to] Testing inline image attachments
« Reply #11 on: August 21, 2023, 06:58:11 pm »


But doing the
Code: [Select]
width= on an image tag doesn't actually load smaller pictures... you're still creating a page full of large images that have to load, and just scaling them down in the browser after. If you look at the source of the above image it's clearly still loading the full sized version of the image.
« Last Edit: August 21, 2023, 07:01:09 pm by abeyer »
 

Online Smokey

  • Super Contributor
  • ***
  • Posts: 2565
  • Country: us
  • Not An Expert
Re: [How to] Testing inline image attachments
« Reply #12 on: August 21, 2023, 11:15:14 pm »


But doing the
Code: [Select]
width= on an image tag doesn't actually load smaller pictures... you're still creating a page full of large images that have to load, and just scaling them down in the browser after. If you look at the source of the above image it's clearly still loading the full sized version of the image.

Is this something anyone really cares about in the age of 5G and broadband?  Maybe we should talk about 4K media streaming bandwidth before we worry about the internet breaking because of full size forum images....
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12851
Re: [How to] Testing inline image attachments
« Reply #13 on: August 22, 2023, 12:30:30 am »
Dave cares - he's paying for all the hosting and bandwidth.
Many users with slower or metered connections care.
Not everyone lives in a 1st world city with good connectivity . . .

If you don't reduce your image resolution and filesize to make it web friendly, you are showing that either you don't care, (and so why should anyone care to help you?) or that you aren't competent to do so, in which case don't expect anything above beginner level answers.

*PLEASE* only inline large images if you need to refer to them in detail in your post e.g. carefully cropped parts of large schematics you are discussing, and also be careful not to quote posts with large inlined images indiscriminately - always consider whether you can strip the image!
« Last Edit: August 22, 2023, 12:39:19 am by Ian.M »
 

Online IanBTopic starter

  • Super Contributor
  • ***
  • Posts: 11853
  • Country: us
Re: [How to] Testing inline image attachments
« Reply #14 on: August 22, 2023, 01:36:56 am »
I always resize and compress images before I upload them.

I have found the best free tool for this job is Microsoft Office Picture Manager. I install it on all my computers.

Details on how to install it here:

https://support.microsoft.com/en-au/office/where-is-picture-manager-58837c3e-34db-4904-95e8-4eca7b7c5730
 

Offline BradC

  • Super Contributor
  • ***
  • Posts: 2106
  • Country: au
Re: [How to] Testing inline image attachments
« Reply #15 on: August 22, 2023, 01:45:29 am »
I always resize and compress images before I upload them.

Me too. Just drop them in a directory and run this :

Code: [Select]
#!/bin/sh
mkdir Scaled
DEST=Scaled
for i in *.jpg *.JPG ; do
convert $i -resize x800 $DEST/$i
done;
 

Online Smokey

  • Super Contributor
  • ***
  • Posts: 2565
  • Country: us
  • Not An Expert
Re: [How to] Testing inline image attachments
« Reply #16 on: August 22, 2023, 02:58:56 am »
Dave cares - he's paying for all the hosting and bandwidth.
Many users with slower or metered connections care.
Not everyone lives in a 1st world city with good connectivity . . .

If you don't reduce your image resolution and filesize to make it web friendly, you are showing that either you don't care, (and so why should anyone care to help you?) or that you aren't competent to do so, in which case don't expect anything above beginner level answers.

*PLEASE* only inline large images if you need to refer to them in detail in your post e.g. carefully cropped parts of large schematics you are discussing, and also be careful not to quote posts with large inlined images indiscriminately - always consider whether you can strip the image!

Show me where the "you only get your question answered if you resize your images per Ian.M's liking" rule is?
Threatening to shun people who don't know how to navigate the broken parts of the forum is sort of messed up. 

If any of this was on the radar of the forum operators they would probably actually just fix the broken image handling.  As far as I know, this stuff has never worked right. 

 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12851
Re: [How to] Testing inline image attachments
« Reply #17 on: August 22, 2023, 04:22:10 am »
There's no such rule, because it should be common sense.  Why should anyone expect to get more out of a community than they are willing to put into it?  Show you don't value the time, effort and resources of others, and see how little help you get from those that care about such things!

Of course you'll get replies from those that don't care, but you've just self-selected for an audience with less experience and knowledge than you originally had available to you.  It may not even be conscious on the part of those that care, e.g. because its tedious to participate in a thread with large page load times (due to multiple large inline images) if you have a slow connection, they are less likely to reply, even if they have significant insight into your question.

Beginners initially get a free pass - they aren't particularly invested here, don't know the culture and it would be nekulturny in the extreme to drive them off by nitpicking their posting style.  OTOH answers they receive are likely to be targeted at their apparent level of understanding so may be less than complete.
« Last Edit: August 22, 2023, 04:27:49 am by Ian.M »
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6177
  • Country: ro
Re: [How to] Testing inline image attachments
« Reply #18 on: August 22, 2023, 04:43:20 am »
Same here, resize and compress before uploading, so those with low speed internet won't see too slow webpages.

Since the camera always names pics as PICTnnnn.JPG, I've added these few lines inside the ~/.bashrc file, to wrap the convert Linux tool into a new bash command webify nnnn[ nnnn].  That can be used from the command line while being in the pics directory.  It does this:

convert PICTnnnn.JPG -strip -matte -resize 1024 -quality 50% -sampling-factor "2x2, 1x1, 1x1" PICTnnnn_s.jpg'

for a batch of one or more pics:
Code: [Select]
# added webify to convert Minolta PICT to 1024 px wide and smallest possible file that still looks OK
# append this content inside the '~/.bashrc' file
# run 'source ~/.bashrc' for the new edits of the '~/.bashrc' to take effected without logout/login
function webify() {
    shrinked_no=0
   
    for var in "$@"
    do
        for f in "${var[@]}"
        do
            s_file=PICT"$f".JPG
           
            for fl in $s_file
            do               
                if [ "${fl##*.}" == "JPG" ]
                then
                    d_file=${fl%.*}_s.jpg
                   
                    if [ -f "$d_file" ]
                    then
                        echo --- skip "$fl" \(already existing "$d_file"\)
                    else
                        echo Shrink "$fl" as "$d_file"
                        convert "$fl" -strip -matte -resize 1024 -quality 50% -sampling-factor "2x2, 1x1, 1x1" "$d_file"
                        shrinked_no=($shrinked_no + 1)
                    fi
                fi         
            done
        done
    done
   
    if [ $shrinked_no -eq 0 ]
    then
        echo webify nnnn[ nnnn]
        echo '  - will shrink file PICTnnnn.JPG as PICTnnnn_s.jpg'
        echo '  - must specify only the nnnn part of the PICTnnnn.JPG'
        echo '  - intended to be used for Minolta DiMage Z1 files named PICTnnnn.JPG'
        echo '  - can take a list of arguments that might include globs/wildcards'
        echo '  - will not overwrite already existing *_s.jpg files'
        echo '  - the webify function is defined inside the ~/.bashrc file'
        echo '  - convert PICTnnnn.JPG -strip -matte -resize 1024 -quality 50% -sampling-factor "2x2, 1x1, 1x1" PICTnnnn_s.jpg'
    fi
}
« Last Edit: August 22, 2023, 04:45:40 am by RoGeorge »
 
The following users thanked this post: Ian.M

Online Smokey

  • Super Contributor
  • ***
  • Posts: 2565
  • Country: us
  • Not An Expert
Re: [How to] Testing inline image attachments
« Reply #19 on: August 22, 2023, 04:59:02 am »
Same here, resize and compress before uploading, so those with low speed internet won't see too slow webpages.

Since the camera always names pics as PICTnnnn.JPG, I've added these few lines inside the ~/.bashrc file, to wrap the convert Linux tool into a new bash command webify nnnn[ nnnn].  That can be used from the command line while being in the pics directory.  It does this:

convert PICTnnnn.JPG -strip -matte -resize 1024 -quality 50% -sampling-factor "2x2, 1x1, 1x1" PICTnnnn_s.jpg'


Ok.  You guys are talking about many megapixel digital camera pictures.  In that case, ya, probably should reduce that.  But I'm not sure who's posting full size digital camera pictures besides the "post a picture of my cat" people.  Forum admins set the max image file size.  What is it set to?

I would bet the majority of images on the forum are screenshots of datasheets and schematics and pictures of stuff people grabbed from some other place on the internet that are already small.  I just checked and a full monitor screenshot using windows snip saves to a 192KB jpg file.
« Last Edit: August 22, 2023, 05:05:00 am by Smokey »
 

Online IanBTopic starter

  • Super Contributor
  • ***
  • Posts: 11853
  • Country: us
Re: [How to] Testing inline image attachments
« Reply #20 on: August 22, 2023, 05:02:10 am »
Ok.  You guys are talking about many megapixel digital camera pictures.
Like a phone camera?

Quote
I would bet the majority of images on the forum are screenshots of datasheets and schematics and pictures of stuff people grabbed from some other place on the internet that are already small.  I just checked and a full monitor screenshot using windows snip saves to a 192KB file.
What about people who post pictures of items in the workshop or circuit boards or other such things?
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6177
  • Country: ro
Re: [How to] Testing inline image attachments
« Reply #21 on: August 22, 2023, 05:16:15 am »
About screenshots, those have a property might worth mention:  big areas of the same color, which means they are more compressible.  For screenshots, PNG format would be preferable to JPG format (in terms of file size) while keeping the same quality as the original.

PNG compression is lossless.  JPG compression is lossy but hard to notice in a normal photo, though easily noticeable in a printscreen with sharp edges like windows and text.

Also, a pic with high level of details would be less compressible, and thus will need bigger files.  For example, the same area of a blank screen will end in a much smaller printscreen file than, say, the same area filled with a fine print text.
« Last Edit: August 22, 2023, 05:19:09 am by RoGeorge »
 
The following users thanked this post: Ian.M

Online magic

  • Super Contributor
  • ***
  • Posts: 6749
  • Country: pl
Re: [How to] Testing inline image attachments
« Reply #22 on: August 22, 2023, 05:50:12 am »
Somewhere in 2021±1 or so the forum got a plugin which automatically recompresses all uploaded images (that's also the point when animated GIFs stopped working).

All your careful compression is in vain. The uploaded image will end up compressed to a pre-set quality level, sometimes even larger than your version.

As a bonus, the attachment's file size is still reported as you uploaded it, but the file served by the forum is different ::)
 
The following users thanked this post: Smokey, Ian.M

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6177
  • Country: ro
Re: [How to] Testing inline image attachments
« Reply #23 on: August 22, 2023, 06:04:34 am »
It's compression and resizing, so I think it does make a difference, but it's funny you say that, because you are on of those low speed interneters complaining when a pic is MB size, and for whom I am preparing smaller files.  ;D

Online magic

  • Super Contributor
  • ***
  • Posts: 6749
  • Country: pl
Re: [How to] Testing inline image attachments
« Reply #24 on: August 22, 2023, 06:11:55 am »
Resizing and choice of format makes a difference in file size. Compression before uploading doesn't.

With JPGs you may as well upload at the original quality to minimize generation loss.
If you want to preserve a JPG loslessly (maybe because it already is overcompressed to begin with) you have to put it in a ZIP or convert to PNG.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf