Git Product home page Git Product logo

Comments (4)

njcrawford avatar njcrawford commented on August 20, 2024

Additional information:
The crash reporter adds that they have a Canon MG5620 printer. The Canon website claims its resolution is 4800x1200 DPI, which is within the expected range.
The reporter also sent a few of the designs that were causing this problem. So far, I'm unable to reproduce the issue on my development system.

from embroideryreader.

njcrawford avatar njcrawford commented on August 20, 2024

I believe the root cause of this was the printer scaling code, mentioned in #12. I wasn't able to get a crash report from beta 2.2.1, but manually walking through the code and doing calculations by hand show that the old scaling code would try to generate a bitmap larger than 2GB[1] when printing a large design at 4800x1200 DPI. (it appears that the X resolution was used for both X and Y, so it was actually calculating for 4800x4800 DPI) The new, correct scaling code seems to stay well within the 2GB limit.
I'm calling this closed for now, pending a test from the original reporter.

[1] Learned something new - .Net GC doesn't allow objects larger than 2GB, even when running on a 64 bit framework.

from embroideryreader.

njcrawford avatar njcrawford commented on August 20, 2024

Another error report, this time from beta 2.2.1. The printer resolution is coming back as -3... I don't know what that means, but I'm guessing it's an error number.

Time: 2016-04-14 09:05:04
Program: embroideryReader, Version=2.2.1.0, Culture=neutral,
PublicKeyToken=null
Program location: C:\Program Files (x86)\Embroidery
Reader\embroideryReader.exe
OS: Windows 10 Home release 1511 (6.3 build 10586) (x64)
OS Culture: en-US
Framework: 4.0.30319.42000 (x64)

Error:
System.ArgumentOutOfRangeException (Specified argument was out of the
range of valid values.
Parameter name: Printer X DPI claims to be '-3', expected range 20 -
10000)
at embroideryReader.frmMain.printDocument1_PrintPage(Object sender,
PrintPageEventArgs e)
at
System.Drawing.Printing.PrintDocument.OnPrintPage(PrintPageEventArgs
e)
at System.Drawing.Printing.PrintController.PrintLoop(PrintDocument
document)
at System.Drawing.Printing.PrintController.Print(PrintDocument
document)
at System.Drawing.Printing.PrintDocument.Print()
at embroideryReader.frmMain.printToolStripMenuItem_Click(Object
sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key,
EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs
e)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs
mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)%
(Report clipped)

from embroideryreader.

njcrawford avatar njcrawford commented on August 20, 2024

PrinterResolution.X is allowed to return negative numbers to indicate general print quality instead of a specific DPI. See https://msdn.microsoft.com/en-us/library/system.drawing.printing.printerresolution.x(v=vs.110).aspx for more.

The value -3 corresponds to DMRES_MEDIUM, according to http://referencesource.microsoft.com/#System.Drawing/commonui/System/Drawing/Advanced/Gdiplus.cs

This has been fixed for beta 2.2.2, because it no longer uses printer resolution values. This issue should be completely resolved by 1b33c47.

from embroideryreader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.