Status: New
Owner: ----
Labels: Type-Defect Priority-Medium Status-Untriaged

New issue 4537 by briandavid7324: Generic error in GDI+ when calling
SaveAsFile for ScreenShot
http://code.google.com/p/selenium/issues/detail?id=4537

What steps will reproduce the problem?

Screenshot myScreenShot = ((ITakesScreenshot)driver).GetScreenshot();
string saveMe = saveLocation + "\\" + dtForFileName + ".jpg";
mybit.SaveAsFile(saveMe, ImageFormat.Jpeg);


The exception is thrown on SaveAsFile.

I have read solutions about not disposing the stream until after the save
but I am not creating my own stream, the SaveAsFile() function does that as
shown below:

using (MemoryStream imageStream = new MemoryStream(this.byteArray))
              {
                  Image screenshotImage = Image.FromStream(imageStream);
                  screenshotImage.Save(filename, format);
              }





Selenium version: 2.24
OS: Windows 7
Browser: IE9
Browser version: 9.0.8112.16421




--
You received this message because you are subscribed to the Google Groups "Selenium Developer Activity" group.
To post to this group, send email to selenium-developer-activity@googlegroups.com.
To unsubscribe from this group, send email to selenium-developer-activity+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-developer-activity?hl=en.

Search Discussions

  • Selenium at Sep 12, 2012 at 9:17 am
    Updates:
      Labels: Component-WebDriver Lang-CSharp

    Comment #1 on issue 4537 by barancev: Generic error in GDI+ when calling
    SaveAsFile for ScreenShot
    http://code.google.com/p/selenium/issues/detail?id=4537

    (No comment was entered for this change.)

    --
    You received this message because you are subscribed to the Google Groups "Selenium Developer Activity" group.
    To post to this group, send email to selenium-developer-activity@googlegroups.com.
    To unsubscribe from this group, send email to selenium-developer-activity+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/selenium-developer-activity?hl=en.
  • Selenium at Apr 19, 2013 at 10:46 pm
    Comment #2 on issue 4537 by a.u.savchuk: Generic error in GDI+ when calling
    SaveAsFile for ScreenShot
    http://code.google.com/p/selenium/issues/detail?id=4537

    Hi!

    is this issue still reproducible? Please recheck it at latest Selenium
    version, please.

    If the issue is still occured please provide full exception ifno, your test
    code and html+css+js or pulic URL at which error is happened.

    --
    You received this message because this project is configured to send all
    issue notifications to this address.
    You may adjust your notification preferences at:
    https://code.google.com/hosting/settings

    --
    You received this message because you are subscribed to the Google Groups "Selenium Developer Activity" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to selenium-developer-activity+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-developer-activity@googlegroups.com.
    Visit this group at http://groups.google.com/group/selenium-developer-activity?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Selenium at May 7, 2013 at 11:18 am
    Updates:
      Status: NeedsClarification

    Comment #3 on issue 4537 by a.u.savchuk: Generic error in GDI+ when calling
    SaveAsFile for ScreenShot
    http://code.google.com/p/selenium/issues/detail?id=4537

    (No comment was entered for this change.)

    --
    You received this message because this project is configured to send all
    issue notifications to this address.
    You may adjust your notification preferences at:
    https://code.google.com/hosting/settings

    --
    You received this message because you are subscribed to the Google Groups "Selenium Developer Activity" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to selenium-developer-activity+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-developer-activity@googlegroups.com.
    Visit this group at http://groups.google.com/group/selenium-developer-activity?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Selenium at Aug 15, 2013 at 7:24 pm
    Updates:
      Status: Fixed
      Labels: Browser-IE

    Comment #4 on issue 4537 by a.u.savchuk: Generic error in GDI+ when calling
    SaveAsFile for ScreenShot
    http://code.google.com/p/selenium/issues/detail?id=4537

    Closing due to inactivity. Please ask to reopen if the issue is still
    actual.

    --
    You received this message because this project is configured to send all
    issue notifications to this address.
    You may adjust your notification preferences at:
    https://code.google.com/hosting/settings

    --
    You received this message because you are subscribed to the Google Groups "Selenium Developer Activity" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to selenium-developer-activity+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-developer-activity@googlegroups.com.
    Visit this group at http://groups.google.com/group/selenium-developer-activity.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Selenium at Mar 14, 2014 at 10:39 am
    Comment #5 on issue 4537 by e.benit...@gmail.com: Generic error in GDI+
    when calling SaveAsFile for ScreenShot
    http://code.google.com/p/selenium/issues/detail?id=4537

    Hi reopening this issue on Producing Screenshot on Safari driver on Mac OSX
    using .Net Webdriver.




    --
    You received this message because this project is configured to send all
    issue notifications to this address.
    You may adjust your notification preferences at:
    https://code.google.com/hosting/settings

    --
    You received this message because you are subscribed to the Google Groups "Selenium Developer Activity" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to selenium-developer-activity+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-developer-activity@googlegroups.com.
    Visit this group at http://groups.google.com/group/selenium-developer-activity.
    For more options, visit https://groups.google.com/d/optout.
  • Selenium at Mar 14, 2014 at 11:26 am
    Comment #6 on issue 4537 by arran.hu...@gmail.com: Generic error in GDI+
    when calling SaveAsFile for ScreenShot
    http://code.google.com/p/selenium/issues/detail?id=4537

    It's a .NET error, nothing to do with Selenium:

    http://stackoverflow.com/questions/1053052/a-generic-error-occurred-in-gdi-jpeg-image-to-memorystream

    --
    You received this message because this project is configured to send all
    issue notifications to this address.
    You may adjust your notification preferences at:
    https://code.google.com/hosting/settings

    --
    You received this message because you are subscribed to the Google Groups "Selenium Developer Activity" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to selenium-developer-activity+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-developer-activity@googlegroups.com.
    Visit this group at http://groups.google.com/group/selenium-developer-activity.
    For more options, visit https://groups.google.com/d/optout.
  • Selenium at Mar 20, 2014 at 7:26 am
    Comment #7 on issue 4537 by e.benit...@gmail.com: Generic error in GDI+
    when calling SaveAsFile for ScreenShot
    http://code.google.com/p/selenium/issues/detail?id=4537

    This issue should be close, it's on the System.drawing library issue.

    Just to help in saving your screenshot. Use binary writer. 100% working

    var screenshot = ((ITakesScreenshot)webDriver).GetScreenshot();
    byte[] imageBytes = Convert.FromBase64String(screenshot.ToString());

    using (BinaryWriter bw = new BinaryWriter(new FileStream(fileName,
    FileMode.Append, FileAccess.Write)))
    {
        bw.Write(imageBytes);
        bw.Close();
    }




    --
    You received this message because this project is configured to send all
    issue notifications to this address.
    You may adjust your notification preferences at:
    https://code.google.com/hosting/settings

    --
    You received this message because you are subscribed to the Google Groups "Selenium Developer Activity" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to selenium-developer-activity+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-developer-activity@googlegroups.com.
    Visit this group at http://groups.google.com/group/selenium-developer-activity.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupselenium-developer-activity @
categoriesselenium
postedSep 11, '12 at 4:36p
activeMar 20, '14 at 7:26a
posts8
users1
websiteseleniumhq.org

1 user in discussion

Selenium: 8 posts

People

Translate

site design / logo © 2021 Grokbase