Resizing Jpeg file using System.Drawing.Image

I searched lot of example but people are missing quite simple using of resizing JPEG file easy and shortest way. Lots of code blocks calculating size of image, layers, cascades etc. . Or using GetThumbNail method has unsatisfied results.So I think resizing JPEG file on c# using System.Drawing.Image library like this;

 

using(Image image = Bitmap.FromStream(imageFileStream))
{
Image thumbImage = newBitmap(image, new Size() {
//Giving new size to image !
Width= (int)(image.Width * 0.16),
Height=(int)(image.Height * 0.16)});
thumbImage.Save(System.IO.Path.Combine(uploadDirectory, “thumb.jpg”), ImageFormat.Jpeg);
}

Resolved:Internal error. Buffer provided to read column value is too small. Run DBCC CHECKDB to check for any corruption.

  1. If you sure your Ms SQL server SP version is greater than SP2 and no need to cumulative service pack 2.
  2. If you checked report after DBCC CHECKDB and found no error so no need to fix MDF file
  3. If you can’t find the reason of that buffer error even installed the hot fixes or last SP

Try this;

For ex If you have a query like Select fxCustomTrim(A) as A , B from tblDestination

And if your fxCustomTrim() function had a return value like “RETURNS varchar(8000)” so change its return max value that you need like varchar(250) so it resolves the buffer error. I don’t know yet why but researching.

SSIS , Value does not fall within the expected range hatası

Eğer Execute SQL Task ile bir SP nin Output değerini döndürmeye çalışıyor ve aşağıdaki hatayı alıyorsasnız , Execute SQL Taskın SQL Statements da SP yi yazdığınız yerdeki syntax ve parametrenin ismine dikkat edin aşağıdaki tabloda verdiğim gibi düzenlemelisiniz. Örneğin default olara OLE DB provider kullanıyor olmalısınız ve one göre “exec sp_procedure ? out” şeklinde yazıp parametresinin isminide “0” olarak vermelisiniz.

Hata Mesajı;

[Execute SQL Task] Error: Executing the query  ? out failed with the following error: “Value does not fall within the expected range.”. Possible failure reasons: Problems with the query, “ResultSet” property not set correctly, parameters not set correctly, or connection not established correctly.

 

“Attempted to read or write protected memory. This is often an indication that other memory is corrupt.” hatası.

.Net Asp 2.0 uygulamanızda Crystal Reports Version=10.2.3600.0 la bir rapor yüklemeye çalıştığınızda “Attempted to read or write protected memory. This is often an indication that other memory is corrupt.” hatası alıyorsanız geçici bir çözüm olarak rapor dökümanına login olmaya çalıştığınız kısmı try catch bloklarına alın. Exception fırlasa dahi rapor yükleniyor. Kalıcı ve diğer çözümler için web te alternetif yollar var tabi.