Jump to content

Unable to Paste from Firefox


evanpage
 Share

Recommended Posts

Okay so before I get told I checked the pinned post regarding 'out of memory' errors.

 

I've been getting 'Not Enough Memory to Paste from Clipboard' quite a lot recently.

As of this moment I am trying to copy a 443x312 jpg and paste into paint.net.
I am using ~35% of my total 16GB RAM. I have over 10GB of free drive space on C:

I'm running Win10 64-bit.

 

Why is this happening?

 

=======

Error log:

=======

System.OutOfMemoryException: Out of memory.

   at System.Drawing.Image.FromFile(String filename, Boolean useEmbeddedColorManagement)

   at PaintDotNet.ClipboardUtil.GetClipboardImageAsSurface(IWin32Window currentWindow, IPdnDataObject clipData) in D:\src\pdn\src\PaintDotNet\ClipboardUtil.cs:line 352

   at PaintDotNet.ClipboardUtil.GetClipboardImageImpl(IWin32Window currentWindow, IPdnDataObject clipData) in D:\src\pdn\src\PaintDotNet\ClipboardUtil.cs:line 215

   at PaintDotNet.ClipboardUtil.GetClipboardImage(IWin32Window currentWindow, IPdnDataObject clipData) in D:\src\pdn\src\PaintDotNet\ClipboardUtil.cs:line 164

   at PaintDotNet.Actions.PasteAction.PerformActionImpl() in D:\src\pdn\src\PaintDotNet\Actions\PasteAction.cs:line 110

Link to comment
Share on other sites

UPDATE: This issue is usually caused by a bug in Firefox. Here's the bug report for those interested in following any progress they make.

https://bugzilla.mozilla.org/show_bug.cgi?id=1340039

 

_____________________________________________

 

A few other people have reported the same issue. It's not actually a memory issue, but rather an issue with the image format.

 

We need to identify the common thread here.

Are you copying an image from a web browser? Which browser? Which version of the browser?

What format (png, jpeg, base64, bmp, ect.) is the image you're copying?

 

Please also post the Diagnostics information from paint.net.

Settings -> Diagnostics -> Copy to clipboard

SettingsDiagnostics.png

Link to comment
Share on other sites

I just got the error trying to Paste into New Image an image from the Average Object Color thread.

 

The image:

FlowerOrig_zpswwo19u0h.png

 

The error message:

System.OutOfMemoryException: Out of memory.
   at System.Drawing.Image.FromFile(String filename, Boolean useEmbeddedColorManagement)
   at PaintDotNet.ClipboardUtil.GetClipboardImageAsSurface(IWin32Window currentWindow, IPdnDataObject clipData)in D:\src\pdn\src\PaintDotNet\ClipboardUtil.cs:line 352
   at PaintDotNet.ClipboardUtil.GetClipboardImageImpl(IWin32Window currentWindow, IPdnDataObject clipData) in D:\src\pdn\src\PaintDotNet\ClipboardUtil.cs:line 215
   at PaintDotNet.ClipboardUtil.GetClipboardImage(IWin32Window currentWindow, IPdnDataObject clipData) in D:\src\pdn\src\PaintDotNet\ClipboardUtil.cs:line 164
   at PaintDotNet.Actions.PasteInToNewImageAction.PerformAction(AppWorkspace appWorkspace) in D:\src\pdn\src\PaintDotNet\Actions\PasteInToNewImageAction.cs:line 46

According to the Task Manager, I have about 3 GB of free memory.

 

Link to comment
Share on other sites

Pdn 4.0.13
Just copied MJW's sunflower image (latest firefox/right click/ copy image) - opened Pdn with a view to creating a new image and pasting.
Didn't get that far as Pdn locked up. Cursor still moved but no controls worked - including minimize and close. Closed it using task manager.
No 'program not responding message'. No error message, No crash report, just 'froze'?

 

Tried a second time and I get the same out of memory error message as above.

 

All these crash reports mention 'useEmbeddedColorManagement' but I thought Pdn didn't use that anyway?

 

Solved (for me)

Disabled the Pinterest Firefox plugin.

 

Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings

 

PdnForumSig2.jpg

Link to comment
Share on other sites

I too have only recently started having this issue. It's not consistent with anything that I can see, except for copying an image from the browser (Firefox). I don't have a Pinterest plugin so I don't know what to try to fix this issue. This is only a recent issue. Today I have had this issue 4 times with different sized images ranging from 40x40 avatars to larger layered images.

 

I would appreciate some help on this as it's becoming very frustrating. Interestingly I just tried to drag and drop from the browser to PDN and it worked fine and opened the image no worries. Right-click to copy the image is where it failed to me.

 

Application    paint.net 4.0.13 (Final 4.13.6191.1824)
Build Date    Tuesday, 13 December 2016
    
Hardware accelerated rendering (GPU)    True
Animations    True
DPI    96.00 (1.00x scale)
Language    en-US
    
OS    Windows 10 (10.0.14393.0)
.NET Runtime    4.0.30319.42000
Physical Memory    12,247 MB
    
CPU    Intel(R) Core(TM) i7 CPU         860  @ 2.80GHz
    Architecture    x64 (64-bit)
    Process Mode    64-bit
    Speed    ~2793 MHz
    Cores / Threads    4 / 8
    Features    DEP, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2
    
Video Card    NVIDIA GeForce 310
    Dedicated Video RAM    459 MB
    Dedicated System RAM    0 MB
    Shared System RAM    3,583 MB
    Vendor ID    0x10DE
    Device ID    0x0A66
    Subsystem ID    0x90601B0A
    Revision    162
    LUID    0x0000D958
    Flags    None
    Outputs    2
    
Video Card    Microsoft Basic Render Driver
    Dedicated Video RAM    0 MB
    Dedicated System RAM    0 MB
    Shared System RAM    6,123 MB
    Vendor ID    0x1414
    Device ID    0x008C
    Subsystem ID    0x00000000
    Revision    0
    LUID    0x0000E108
    Flags    Software
    Outputs    0

 

Edited by Adsy
Additional information
Link to comment
Share on other sites

5 hours ago, Red ochre said:

Just copied MJW's sunflower image (latest firefox/right click/ copy image)

 

I got as far as trying to paste the image...

 

Spoiler

System.OutOfMemoryException: Out of memory.

   at System.Drawing.Image.FromFile(String filename, Boolean useEmbeddedColorManagement)

   at PaintDotNet.ClipboardUtil.GetClipboardImageAsSurface(IWin32Window currentWindow, IPdnDataObject clipData) in D:\src\pdn\src\PaintDotNet\ClipboardUtil.cs:line 352

   at PaintDotNet.ClipboardUtil.GetClipboardImageImpl(IWin32Window currentWindow, IPdnDataObject clipData) in D:\src\pdn\src\PaintDotNet\ClipboardUtil.cs:line 215

   at PaintDotNet.ClipboardUtil.GetClipboardImage(IWin32Window currentWindow, IPdnDataObject clipData) in D:\src\pdn\src\PaintDotNet\ClipboardUtil.cs:line 164

   at PaintDotNet.Actions.PasteAction.PerformActionImpl() in D:\src\pdn\src\PaintDotNet\Actions\PasteAction.cs:line 110

 

Link to comment
Share on other sites

As toe_head2001 stated earlier in this thread:

On 2/13/2017 at 2:42 AM, toe_head2001 said:

A few other people have reported the same issue. It's not actually a memory issue, but rather an issue with the image format.

 

The Image.FromFile method throws an OutOfMemoryException when it does not support loading the image.

From MSDN:

Quote

If the file does not have a valid image format or if GDI+ does not support the pixel format of the file, this method throws an OutOfMemoryException exception.

 

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

I looked into the issues this morning.

 

TL;DR: Firefox's fault. It's saving HTML as a PNG image. Ok, I guess it's PhotoBucket's fault too, because they are redirecting requests to the PNG image to an HTML page.

 

 

While Firefox places several formats on the clipboard (including valid Bitmaps/DIBs), paint.net ends up trying to load an invalid PNG image. Too bad the image is actually HTML code saved as a PNG.

 

 

 

Here's the PNG file on the clipboard:

png-clipboard.png

 

And here's the content of the "PNG" file:

png-contents.png

 

 

Chromium based browsers (Chrome, Vivaldi, ect.) don't place so many formats on the clipboard, so paint.net ends up loading the Bitmap/DIB, thus avoiding the issue of PhotoBucket redirecting requests to PNG images.

Edited by toe_head2001
fixed broken images
  • Upvote 1
Link to comment
Share on other sites

Microsoft Paint seems to have no problem pasting the images that PDN gives the memory error on. I copied my flower image to the clipboard and tried pasting into PDN. I got the "not enough memory" error. I then went to an open MS Paint window and clicked the Paste button. The image was immediately pasted. I tried with a different image, with the same result. If there's a problem with the image data in the clipboard, it's a problem MS Paint can deal with.

Link to comment
Share on other sites

One thing I just realized is that I can use the problematic clipboard images in plugins that use the clipboard, such as the Texture Shader and Texture Merger. So, if PDN can identify it's supposed to be a PNG image, and if PDN can access the data, isn't it better to fix it to work, even if it's technically Firefox's problem?

Link to comment
Share on other sites

2 hours ago, MJW said:

So, if PDN can identify it's supposed to be a PNG image, and if PDN can access the data, isn't it better to fix it to work, even if it's technically Firefox's problem?

Personally, yes, I think a workaround would be ideal.

In my previous post, I should have said something more like: "It's an issue in Firefox that exposes a limitation of paint.net".

 

Paint.net is just weird about selecting a format from the clipboard. I've brought this up before:

http://forums.getpaint.net/index.php?/topic/31799-selecting-a-format-from-the-clipboard/

Link to comment
Share on other sites

10 hours ago, BoltBait said:

Rick is unlikely to change his clipboard handling code.

 

Any changes made would mean trade-offs that he's unwilling to make.

 

Nevertheless, it's worth investigating.

 

If this can be reproduced easily and consistently, I can look into it and hopefully find understanding on this issue.

 

So if someone has a list of dummy-proof and very specific instructions to recreate this, I can check it out. This is really important so that I can recreate the problem and verify the fix (assuming there is one).

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

1 hour ago, Rick Brewster said:

So if someone has a list of dummy-proof and very specific instructions to recreate this, I can check it out. This is really important so that I can recreate the problem and verify the fix (assuming there is one).

 

There's an image of flowers (from my PaintBucket account)  in my comment above. If you use Copy Image to copy the image, then try to import it into PDN using Paste into New Image, you should see the "Not enough memory" error.

Link to comment
Share on other sites

9 hours ago, MJW said:

 

There's an image of flowers (from my PaintBucket account)  in my comment above. If you use Copy Image to copy the image, then try to import it into PDN using Paste into New Image, you should see the "Not enough memory" error.

 

Copy Image ... from what source? Chrome? Firefox? Like I said, very specific instructions :)

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Okay I should have a fix for this in the next update, even if Firefox doesn't fix anything on their side.

 

Paint.NET has a prioritized list of formats that it goes through. If data isn't available in format 1, it will then try format 2, then format 3, etc. However, if any format throws an OutOfMemoryException, the whole process stops and is aborted.

 

The fix is that an OOME won't cause an abort. The format will be retried once after a full garbage collection is forced, and then if it still won't work then the next format will be tried.

 

And it works great with whatever Firefox is doing.

  • Upvote 4

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

  • 1 month later...
  • toe_head2001 changed the title to Unable to Paste from Firefox

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.

 Share

×
×
  • Create New...