Click here to Skip to main content
15,894,291 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Export to calendar Pin
m@dhu27-Jul-10 19:14
m@dhu27-Jul-10 19:14 
GeneralRe: Export to calendar Pin
Sandeep Mewara27-Jul-10 19:21
mveSandeep Mewara27-Jul-10 19:21 
QuestionHandling digital camera images with System.Drawing Pin
NeverHeardOfMe27-Jul-10 11:33
NeverHeardOfMe27-Jul-10 11:33 
AnswerRe: Handling digital camera images with System.Drawing Pin
Luc Pattyn27-Jul-10 12:35
sitebuilderLuc Pattyn27-Jul-10 12:35 
GeneralRe: Handling digital camera images with System.Drawing Pin
NeverHeardOfMe27-Jul-10 14:21
NeverHeardOfMe27-Jul-10 14:21 
GeneralRe: Handling digital camera images with System.Drawing Pin
Luc Pattyn27-Jul-10 14:43
sitebuilderLuc Pattyn27-Jul-10 14:43 
GeneralRe: Handling digital camera images with System.Drawing [modified] Pin
NeverHeardOfMe27-Jul-10 21:57
NeverHeardOfMe27-Jul-10 21:57 
GeneralRe: Handling digital camera images with System.Drawing Pin
Luc Pattyn28-Jul-10 0:56
sitebuilderLuc Pattyn28-Jul-10 0:56 
Hi,

I assume this is the code that includes your work-around, not the one that fails occasionally. If you remove the extension modifications, it may fail because, under some conditions, you attempt an Image.Save whereas your original image still is alive since FullSizeImage.Dispose() only occurs later. The fix is to move FullSizeImage.Dispose() up and put it in between gX.DrawImage() and tmp.Save()

I have some more comments:

1.
your big three-way switch is unnecessary, you could handle portrait/landscape/square images all the same by using something like:
x1 = CInt((FullSizeImage.Width / 2) - (FullSizeImage.Height / 2))
y1=-x1
if x1<0 then x1=0
if y1<0 then y1=0


2.
I don't think you need bTidy at all.

3.
I'm puzzled by your call to SetAttributes; it seems very likely you either don't need it at all, or you also need it when the input image is "too small".

4.
I would suggest you replace all those magic "200" constants by a single variable, and probably make it a function parameter.

Overall I would suggest you look for simpler ways to organize your code; anytime you duplicate statements (or constants) you should try and find a better way, the DRY principle (Don't Repeat Yourself) is pretty universal.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.


GeneralRe: Handling digital camera images with System.Drawing Pin
NeverHeardOfMe28-Jul-10 1:13
NeverHeardOfMe28-Jul-10 1:13 
Questiondoubt in Classic ASP Pin
Xandip27-Jul-10 11:28
Xandip27-Jul-10 11:28 
AnswerRe: doubt in Classic ASP Pin
Ankur\m/27-Jul-10 18:38
professionalAnkur\m/27-Jul-10 18:38 
QuestionGenerate Sequential Number without database Pin
Maikeru200027-Jul-10 9:42
Maikeru200027-Jul-10 9:42 
AnswerRe: Generate Sequential Number without database Pin
Stoffy197227-Jul-10 9:50
Stoffy197227-Jul-10 9:50 
GeneralRe: Generate Sequential Number without database Pin
Yusuf27-Jul-10 10:07
Yusuf27-Jul-10 10:07 
GeneralRe: Generate Sequential Number without database Pin
Stoffy197227-Jul-10 10:21
Stoffy197227-Jul-10 10:21 
AnswerRe: Generate Sequential Number without database Pin
David Mujica27-Jul-10 9:57
David Mujica27-Jul-10 9:57 
AnswerRe: Generate Sequential Number without database Pin
Yusuf27-Jul-10 10:22
Yusuf27-Jul-10 10:22 
GeneralRe: Generate Sequential Number without database Pin
Maikeru20002-Aug-10 5:16
Maikeru20002-Aug-10 5:16 
AnswerRe: Generate Sequential Number without database Pin
T M Gray27-Jul-10 10:23
T M Gray27-Jul-10 10:23 
GeneralRe: Generate Sequential Number without database Pin
Maikeru200027-Jul-10 10:40
Maikeru200027-Jul-10 10:40 
GeneralRe: Generate Sequential Number without database Pin
T M Gray27-Jul-10 10:44
T M Gray27-Jul-10 10:44 
AnswerRe: Generate Sequential Number without database Pin
Adam R Harris28-Jul-10 8:52
Adam R Harris28-Jul-10 8:52 
Questiontips&tricks template Pin
farokhian27-Jul-10 5:39
farokhian27-Jul-10 5:39 
AnswerRe: tips&tricks template Pin
David Mujica27-Jul-10 6:02
David Mujica27-Jul-10 6:02 
Questionerror in dataRelation in asp.net [modified] Pin
Dhyanga27-Jul-10 3:08
Dhyanga27-Jul-10 3:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.