.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

JPEGS with empty IPTC / APP14 Tags cause GDI+ error

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :.NET Framework
I am curious as to why the GDI+ libraries error our with exc = {"A generic error occurred in GDI+."} when the IPTC headers are empty.  I would assume it should reasonably take care of this.  I have taken am image and changed the "ff ed" app14 marker to more generic "ff ec" and everything loads fine and dandy.  So by analysis I am looking at a jpg the IPTC header has no data and I am guessing the GDI+ libraries dont handle empty data very well.  Anyone else having this problem.  Only workaround which is expensive is creating a new image and saving it to the stream which in a sense basically strips the header data making it more generic of an image.   System.Drawing.Image image = Image.FromFile("c:\\test6.jpg"); System.Drawing.Image image2 = null; ImageFormat format = ImageFormat.Jpeg; using (var stream = new MemoryStream()) { try { image.Save(stream, format); //using jpg with empty IPTC data will throw GDI+ error } catch (Exception exc) { image2 = new Bitmap(image);//this is expensive but gets job done image2.Save(stream, format); } context.HttpContext.Response.BinaryWrite(stream.ToArray()); } JPG Hex Bytes from beginning of file.  The Internal of the stream will error out about 24 bytes with a lengt

View Complete Post

More Related Resource Links

error in MVC2 on empty string form fields which are required: "This property cannot be set to a null

In model I have:[DisplayName("ISBN")] [Required(ErrorMessage = "ISBN is required.")] [StringLength(50, ErrorMessage = "ISBN book must have max {1} chars.")] [DisplayFormat(ConvertEmptyStringToNull = false)] public string isbn { get; set; }But when I submit form with empty field ISBN I have an error - ConstraintException: This property cannot be set to a null value.I have find that other people have the same problem and they say that debbugger in VS2010 works wrong - yes ?http://p2p.wrox.com/book-professional-asp-net-mvc-2/79788-constraintexception-unhandled-user-code.html#post259245http://efreedom.com/Question/1-3129080/Server-Side-Validation-REQUIRED-String-Property-MVC2-Entity-Framework-Workhttp://mvcmusicstore.codeplex.com/workitem/6604

Profile page throwing an error after adding some "ask me about" tags

After adding some "ask me about" tags my profile page is throwing an error. To be more precise the AskMeAbout WebPart ist throwing a thread aborted exception and I don't understand the reason for this error. After removing the tags the sites works again. Some tags work but after trying some other tags the profile page is broken again. Unhandled exception caught during execution of Microsoft.SharePoint.Portal.PageBase::ErrorHandler(). Exception information: Exception information: Microsoft.SharePoint.WebPartPages.WebPartException: Thread was being aborted. ---> System.Threading.ThreadAbortException: Thread was being aborted. at Microsoft.SharePoint.Portal.WebControls.AskMeAboutWebPart.RenderValues(HtmlTextWriter writer, Int32 startIndex, Int32 endIndex) at Microsoft.SharePoint.Portal.WebControls.AskMeAboutWebPart.RenderWebPart(HtmlTextWriter writer) at Microsoft.SharePoint.WebPartPages.WebPart.Render(HtmlTextWriter writer) at Microsoft.SharePoint.WebPartPages.SPChrome.RenderPartContents(HtmlTextWriter output, WebPart part) - -- End of inner exception stack trace --- at Microsoft.SharePoint.WebPartPages.SPChrome.RenderPartContents(HtmlTextWriter output, WebPart part) at Microsoft.SharePoint.WebPartPages.SPChrome.RenderWebPart(HtmlTextWriter output, WebPart part) at Microsoft.SharePoint.WebPartPages.WebPartZone.RenderZoneCell(HtmlTex

when used with other Tags gives Error in Configuration

Hi,I am using appsettings to store some key-value pairs to be used in my application.I am also using log4net, a logging ToolHence for log4net to work i need to add below tag into the app.config file along with <appSettings>. <?   xml version="1.0" encoding="utf-8" ?><configuration><appSettings><add key="path" value="C:\\localhost.txt"/></appSettings><log4net><appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender"><file value="C:\temp\calleguas\DataUpdateLogger.log" /><appendToFile value="true" /><rollingStyle value="Size" /><maxSizeRollBackups value="10" /><maximumFileSize value="1000KB" /><staticLogFileName value="true" /><layout type="log4net.Layout.PatternLayout"><param name="ConversionPattern" value="%d{dd MMM yyyy HH:mm:ss} %-5p - %m%n" /></layout></appender><root><level value="Error" />Use Info value for any debugging purpose only<appender-ref ref="RollingFileAppender" /><appender-ref ref="ColoredConsoleAppender" /></root></log4net></configuration>When i remove the log4net tag then only the appSetting values can be retrie

How to detect empty element closing tags in XmlTextReader?

How do I detect the closure of an element in the form of <foo  stuff.stuff.stuff   />   ?

In this (Microsoft generated) XAML fragment  . . .

<Window x:Class="WpfXml2.Window1"
    Title="Window1" Height="372.185" Width="613.272">
    <Grid Width="534.391">
        <ListBox Margin="41,66,37,11.891" Name="listBox1" FontFamily="Ariel" FontSize="12" />
        <Label Height="24.442" HorizontalAlignment="Right" Margin="0,23.331,105.545,0" Name="label1" VerticalAlignment="Top" Width="120">Label</Label>

. . .

Using MoveToElement() when I get to the start of Listbox it has a NodeType of "Element" and a Name of "Listbox"  (as I expected)  On the next MoveToElement() it shows a NodeType of "Whitespace" and IsEmpt

How to resolve this error? - Database on SQL Server instance is not empty and does not match current

Upgrade form MOSS 2007 to Sharepoint 2010.  Reviewing the event log I see the following error.  Not sure what to do and hoping someone can provide some guidance please.

- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
  <Provider Name

Receiving a fatal error 3624 @pageref.cpp:913 inserting into an empty table


Hi guys,

I'm using Integration Services to insert rows into a SQL Server 2008 table, and I'm receiving an error - only when the table is empty before the insert.  I use SSIS quite frequently, and this is the first time I've seen this kind of issue.  Since I'm getting some internal errors that seem related to the engine in the reports, I figured I'd post here for ideas.

Here's the dump from the Agent job that runs the package:

Executed as user: CORP\_DWAdmin_Service. Microsoft (R) SQL Server Execute Package Utility  Version 10.0.2531.0 for 64-bit  Copyright (C) Microsoft Corp 1984-2005. All rights reserved.    Started:  8:38:29 PM  Error: 2010-10-11 20:39:14.14     Code: 0xC0202009     Source: Insert New Records DIM_CUSTOMER [6]     Description: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.  An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0"  Hresult: 0x80004005  Description: "Warning: Fatal error 3624 occurred at Oct 11 2010  8:39PM. Note the error and time, and contact your system administrator.".  An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0"  Hresult: 0x800

TreeView Empty Leaf cause error


 I have a treeview that shows 'Deals'>DocumentType>DocumentFileName

If there is no documentFileName In a particular DocumentType it causes a javascript error.

How do I avoid this. Thanks.

Imports Microsoft.VisualBasic
Imports System
Imports System.Data
Imports System.Collections
Imports System.Configuration
Imports System.Data.SqlClient
Imports System.Web.UI
Imports System.Web.UI.WebControls
Public Class DealDocs
    ' From http://quickstarts.asp.net/QuickStartv20/util/srcview.aspx?path=~/aspnet/samples/ctrlref/navigation/TreeView/TreeView11.src&file=TreeViewDatabase_vb\App_Code\WarehouseDB.vb&lang=VB+Source

    Public Shared Function GetDocTypes() As doctypeList

        Dim doctypes As New doctypeList

        Dim connStr As String = ConfigurationManager.ConnectionStrings("DB_6056_securedeConnectionString").ConnectionString
        Dim mySource As SqlDataSource = New SqlDataSource(connStr, "procGetDocTypes")
        mySource.SelectCommandType = SqlDataSourceCommandType.StoredProcedure

        Dim result As IEnumerable = mySource.Select(DataSourceSelectArguments.Empty)

        Dim row As DataRowView
        For Each row In result

            doctypes.Add(New doctype( _
                row("DocTypeId").ToString(), _

Report Builder returning #Error value in empty fields and working with Date field


Hey guys,

I am trying to build a report using the date field from CRM and only wanting to return the date I am using this expression "=Fields!new_date.Value.ToShortDateString()" but when there is an empty fiel I get #Error. How do I solve this?

Also is there anyway to return the date field with the actual month showing instead of the numerical value? i.e. instead of 1/31/2010 Have it show January 31, 2010 (Doesn't have to be exactly in that format, but want the name value for the month.)

Webpart causing authentication error when cache is empty - showing just fine, when a lokal admin has



I'm having some trouble with a webpart and some rights, I think.

I have created a webpart, showing some data from at database. Based on which Active Directory group the user is in, some part of the webpart is either show or hidden.

My problem is now, that every morning, the webpart causes an error, saying you need to logon. When I open the same page from the local machine with a local admin, the webpart shows up, and the webpart is now show as it should for everyone.
This behaviour happens next morning.

The webpart is deployed to the GAC.
I also sometimes se the problem when a user, who is in a group that enables them to se the "add comment" part of my webpart, they get the error, but the user, which are NOT allowed to se the "add comment" part see the webpart just fine.

I hope it is clear, what my problem is, but I will gladly try to explain deeper, what the issue is.


for xml path output - empty tags should be

here's tha sample code:
'alpha' _name,
'alp333' _username
for xml path(''), type),
(select ccy, acc  from #samp
for xml path(''), type)
for xml path('ccyXML'),elements
current output:
    <acc />
    <acc />

IsapiModule Error 500 Issue


I am about exhausted trying to figure out this error:

HTTP Error 500.0 - Internal Server Error

Description: The page cannot be displayed because an internal server error has occurred.

Error Code: 0x8007007b

Notification: ExecuteRequestHandler

Module: IsapiModule

Requested URL: http://localhost:80/ReportServer

Physical Path: c:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer

When I enable Failed Request Tracing Rules and view the log output I am supposing that the actual problem is in the 2nd call where there are 2 backslashes before the actual filename in the specified path:


CALL_ISAPI_EXTENSION DllName="C:\Windows\Microsoft.NET\Framework\v2.0.50727\\aspnet_isapi.dll"


Handling 404 page not found with Error page



      How do i handle 404 page not found?

Inserting personal error message in ValidationSummary



I am creating a web form that requires a lot of validation. I use many of the validation control in asp.net already like RequiredFieldValidator and CompareValidator. 

My Problem: after my custom validation for the value entered return an error message, and I pressed enter key when the field is empty, my custom error message is overlapped by my ValidationSummary. 

Setting my custom error to visible = false on button click also does not seem to work as it requires for me to enter the value first.

This made me think, is there a way to insert my custom validation inside the ValidationSummary as an error message like for other validation control?

Thanks in advance

Sys.Net.WebServiceFailedException: The server method '' failed with the following error:



Let's say we have 2 time consuming functions, aaa and aaa1 inside a aspx page.

        public static string aaa(int i)
            return i.ToString();

        public static string aaa1(int i)
            return i.ToString();



        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        <span id="displayspan"></span>
        <br />
        <input type="button" value=

Jscript error: Object does not support property or method


 Hi, i have little knowledge on javascript but i need to use this code get from somewhere for a jquery to work.

I face this "Jscript runtime error: Object does not support property or method" whenever im trying to run this page.

In my experience, im get this error msg 9 out of 10 times i use javascript in my system.

Im using Microsoft Visual web developer 2008, i wonder if this is related to my problem, i not sure there is anything i need to add as reference or update anything.

But anyway, in short, i just couldn't use javascript code when using this development tool because of this sort of error.

Anyway, it happen that last time i tried use the same type of jquery code in another project and it seems to work well without an error.

But now when im try to use it again in this recent project i created, it come out with this error and i have no idea how to solve it even look through google and this forum.

It doesn't really seems like its the code problem itself although im not sure, because any javascript code just couldn't work.

So below is my code that i need to use.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
<script type="text/javascript" src=&quo

Type or namespace error.


A couple of days ago I started getting an unusual behavior when compiling Website projects. I have referenced class libraries added to my bin folder that are also correctely referenced in using statements in my aspx.cs code behind. When I compile, I get the 

Error 4 The type or namespace name 'CommonClassLibrary' could not be found (are you missing a using directive or an assembly reference?) C:\Dev\Fiscal_Portal\Implementation\FMS Portal Site_new\App_Code\BLL\DataTables.cs 1 7 C:\...\FMS Portal Site_new\

The type or namespace name 'CommonClassLibrary' could not be found (are you missing a using directive or an assembly reference?)

error message that would typically be received when the dll has not been added as a reference or added in a using statement.

I can eliminate the error by adding an


HTTP Error 403 - Forbidden


(VB Express website directed me to ASP.NET Web Services which in turn redirected me to this forum).

 Hopefully someone can help me here...... 

I am using VIsual Web Developer and downloaded the small business application to use as a starting point to help my wife get a website up for her small business. When I load the application, I can F5 and it runs fine but as soon as I make any modification to the app and hit F5, I get the HTTP Error 403 - Forbidden when it tries to show the website.

I notice a pop up that occurs when I run that allows me to choose the link for my app and it displays correctly (I close the webpage that has the error on it).

This seems like a pain, is there a setting I'm missing - I would think that this should "just work".

What's up?????



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend