Jump to content

LabVIEW snippet PNGs are being sanitized


Recommended Posts

  • 2 years later...

Old post, but I am having this problem, too.  How does one post a snippet anyway?  I've tried attaching them to the post, but they get resized, and the embedded code is stripped away.  Not a very good feature for the premier independent LabVIEW web forum.  Is there some other way to add a PNG to the message without attaching it, or clicking the "add to post" button?


Here is an example of a snippet added using the attachment feature of the "More Reply Options" page.  I also used the "Add to Post" link next to the attached file:

 

post-17965-0-17462700-1432750089_thumb.p

 

Why does it shrink the image all the way down to a thumbnail?  Most monitors today are huge, with wide aspect ratios, and plenty of resolution.  Why not upload the PNG "as is"?  Most snippets are below one screen in size, and any that are larger will get "resized" for display by the browser.  

 

Also tried the "Advanced Uploader":

 

post-17965-0-91016700-1432750354_thumb.p

 

Being able to share snippets without the code getting stripped would be a good thing.

Link to post

I think I reproduced the steps you took, but I came to a different result.  I posted a reply using the More Reply Options which is also known as the full editor.

 

From there I picked the file by clicking on Choose File.  Then I clicked Attach This File.  This step might not be needed depending on the version of the uploader that you are using.  Then I clicked Add to Post to add it to my reply.  I was then able to click the image and get the VI source by dragging the image to my desktop.

 

I wonder if it has to do with the size of the PNG you uploaded.  It obviously scaled it which makes me think there is a maximum resolution the uploader accepts.

 

post-6627-0-95578300-1432751022.png

 

EDIT: Yup just tested it, too large of an image is scaled, I'll let Michael know about his and see if there is something that can be done.

Link to post

Michael worked his magic, that he does so well and things should work now.  I tested it on a pretty large block diagram and my browser zoomed out, but the image itself wasn't scaled on the server side, so I could still drag the snippet away and then into my blank block diagram.

  • Like 1
Link to post
  • 3 years later...
  • 4 weeks later...
On 12/11/2018 at 6:16 PM, Michael Aivaliotis said:

I think something got changed in the upgrade, but i think i fixed it now.

Unfortunately it isn't. Can you check again?

Here is one of my posts for reference with multiple code snippets (also some of the previous posts as well):

The first image has an original size of 26,392 bytes but the file in the post is only 12,304 bytes. That is the fully-zoomed image from here:

https://lavag.org/uploads/monthly_2019_01/591079262_AccessingElementsinaFor-Loop_vi.png.739aeb22d70a5a697b28a8358c333ffb.png

Let me know if I'm doing that wrong

Edited by LogMAN
Link to post
2 hours ago, Michael Aivaliotis said:

Can someone point me to an online post with a working snippet? On LAVA or elsewhere.

I was going to be flippant and say "The NI forum has loads" but they don't work either.:frusty:

Link to post
4 hours ago, ShaunR said:

I was going to be flippant and say "The NI forum has loads" but they don't work either.:frusty:

It used to work, then it stopped: https://forums.ni.com/t5/LabVIEW/Notice-Attach-VI-Snippets-to-post-rather-than-upload/td-p/3660471

Attachments (as opposed to inline images) should be fine, apparently.

Link to post

And referenced in that post is my work around.  It isn't so much that the PNGs are having meta data stripped, it is that they have a custom image viewer which adds a scaling size.  Viewing the raw image still allows snippets.  Also downloading the snippet might work too.

https://forums.ni.com/t5/Feedback-on-NI-Community/How-do-I-get-a-snippet-from-the-board-into-my-block-diagram/m-p/3763571#M15575

So Michael here is a working snippet from NI's site:

https://forums.ni.com/t5/image/serverpage/image-id/214063iB57FB649CBEA2ED8

Link to post

In this last post of the working snippet. can you explain how you added the image/snippet? I can't seem to reproduce your embed process. When I add an image it adds it and the name changes with an appended hash. it also changes the behavior so when you click it, it pops up in a viewer window. However, with your embed, the image retains its name and clicking it does nothing.

Link to post

Indeed, the location is different => https://lavag.org/applications/core/interface/file/attachment.php?id=13529

If you go to your profile (icon in the top right) and select "My Attachements", the files listed there show a different file location than the ones in posts. Here is mine from above:

My Attachments

https://lavag.org/applications/core/interface/file/attachment.php?id=13701

This one probably works (not tested, just a guess)

Edit: it doesn't.

Post

https://lavag.org/uploads/monthly_2019_01/591079262_AccessingElementsinaFor-Loop_vi.png.739aeb22d70a5a697b28a8358c333ffb.png

Edited by LogMAN
Link to post

To clarify the second image was posted before the forum update. Here's the thread:

https://lavag.org/topic/20671-programmatically-select-all-boolean-best-way-to-avoid-race-condition/?tab=comments#comment-125949

So, I'm guessing the forum is stripping the metadata on upload now. I reposted that image in this thread by copying the link into the editor box. The box "embedded" the image for me automatically.

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.