473,320 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

C# ASP.NET Thumbnail Generator issue

Greetings all,

I am having a problem with an asp.net application using C# which is a
thumbnail generator. Here is the code used...

http://www.eggheadcafe.com/articles/20030515.asp

It works fine for .jpg images but for some reason it doesn't work with .gif
images. The author of the article says it works fine for him but I can't get
it to work. I was wondering if anyone here can shed some light?

I have my permissions set for read, write, etc.. and as I said it works fine
for jpg's.

Thanks, David
Nov 19 '05 #1
10 2012
Any guesses, shots in the dark?

David


"David" <ri***@dd.com> wrote in message news:yTvbe.1337$vj1.382@trnddc01...
Greetings all,

I am having a problem with an asp.net application using C# which is a
thumbnail generator. Here is the code used...

http://www.eggheadcafe.com/articles/20030515.asp

It works fine for .jpg images but for some reason it doesn't work with ..gif images. The author of the article says it works fine for him but I can't get it to work. I was wondering if anyone here can shed some light?

I have my permissions set for read, write, etc.. and as I said it works fine for jpg's.

Thanks, David

Nov 19 '05 #2
The problem is, you used code you didn't understand. My advice would be to
study it, keep the .Net SDK handy, study it until you own it, and when you
understand it all of your problems will go away. In addition, the next time
you run into a similar (but not the same) problem, you will be able to write
your own solution straight out of your head.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"David" <ri***@dd.com> wrote in message news:rlCbe.8158$yc.1063@trnddc04...
Any guesses, shots in the dark?

David


"David" <ri***@dd.com> wrote in message
news:yTvbe.1337$vj1.382@trnddc01...
Greetings all,

I am having a problem with an asp.net application using C# which is a
thumbnail generator. Here is the code used...

http://www.eggheadcafe.com/articles/20030515.asp

It works fine for .jpg images but for some reason it doesn't work with

.gif
images. The author of the article says it works fine for him but I can't

get
it to work. I was wondering if anyone here can shed some light?

I have my permissions set for read, write, etc.. and as I said it works

fine
for jpg's.

Thanks, David


Nov 19 '05 #3
Thanks for the reply it does help but I do understand the code more or less.
Yes, I am new to .Net and I have studied the documentation on the Microsoft
site and can not find anything amiss in the code. Also, I'm not a C#
programmer, I am a Javascript programmer and there are times I even need
help with the js code but not very often. Granted the languages 'are'
different but mostly in the syntax.

I will take your suggestion though and do some more research of course. Just
hoping someone here that is more profecient in the .Net framework could lend
a hand or spot something obvious. This is what the forum is for no?

David

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:em**************@TK2MSFTNGP12.phx.gbl...
The problem is, you used code you didn't understand. My advice would be to
study it, keep the .Net SDK handy, study it until you own it, and when you
understand it all of your problems will go away. In addition, the next time you run into a similar (but not the same) problem, you will be able to write your own solution straight out of your head.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
What You Seek Is What You Get.

"David" <ri***@dd.com> wrote in message

news:rlCbe.8158$yc.1063@trnddc04...
Any guesses, shots in the dark?

David


"David" <ri***@dd.com> wrote in message
news:yTvbe.1337$vj1.382@trnddc01...
Greetings all,

I am having a problem with an asp.net application using C# which is a
thumbnail generator. Here is the code used...

http://www.eggheadcafe.com/articles/20030515.asp

It works fine for .jpg images but for some reason it doesn't work with

.gif
images. The author of the article says it works fine for him but I
can't get
it to work. I was wondering if anyone here can shed some light?

I have my permissions set for read, write, etc.. and as I said it works

fine
for jpg's.

Thanks, David



Nov 19 '05 #4
You're on the right track, David. Unfortunately, you didn't post your code.
You only posted the link to the article and its code. I don't have the time
to debug the article's code, and make sure that the problem isn't there. So
I gave you a methodology that has always worked for me.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"David" <ri***@dd.com> wrote in message news:RzZbe.2544$iZ1.18@trnddc03...
Thanks for the reply it does help but I do understand the code more or
less.
Yes, I am new to .Net and I have studied the documentation on the
Microsoft
site and can not find anything amiss in the code. Also, I'm not a C#
programmer, I am a Javascript programmer and there are times I even need
help with the js code but not very often. Granted the languages 'are'
different but mostly in the syntax.

I will take your suggestion though and do some more research of course.
Just
hoping someone here that is more profecient in the .Net framework could
lend
a hand or spot something obvious. This is what the forum is for no?

David

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:em**************@TK2MSFTNGP12.phx.gbl...
The problem is, you used code you didn't understand. My advice would be
to
study it, keep the .Net SDK handy, study it until you own it, and when
you
understand it all of your problems will go away. In addition, the next

time
you run into a similar (but not the same) problem, you will be able to

write
your own solution straight out of your head.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
What You Seek Is What You Get.

"David" <ri***@dd.com> wrote in message

news:rlCbe.8158$yc.1063@trnddc04...
> Any guesses, shots in the dark?
>
> David
>
>
>
>
> "David" <ri***@dd.com> wrote in message
> news:yTvbe.1337$vj1.382@trnddc01...
>> Greetings all,
>>
>> I am having a problem with an asp.net application using C# which is a
>> thumbnail generator. Here is the code used...
>>
>> http://www.eggheadcafe.com/articles/20030515.asp
>>
>> It works fine for .jpg images but for some reason it doesn't work with
> .gif
>> images. The author of the article says it works fine for him but I can't > get
>> it to work. I was wondering if anyone here can shed some light?
>>
>> I have my permissions set for read, write, etc.. and as I said it
>> works
> fine
>> for jpg's.
>>
>> Thanks, David
>>
>>
>
>



Nov 19 '05 #5
I gave a link to the original article because it supposedly works, but not
for me. Here is a link to my code which is simpler.

http://mysite.verizon.net/res8xvny/temp2/theCcode.htm

As I said, it works wonderfully for .jpg's but not for .gif's.

I don't disagree with your methodology as it works for me too, but after too
many hours one seeks a fresh eyeball on the problem. Hence my post. If you
don't have the time to take a look, I understand, no problem. I'm just
asking here on the forum and if anyone has an idea.

David

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:Oo****************@TK2MSFTNGP09.phx.gbl...
You're on the right track, David. Unfortunately, you didn't post your code. You only posted the link to the article and its code. I don't have the time to debug the article's code, and make sure that the problem isn't there. So I gave you a methodology that has always worked for me.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
What You Seek Is What You Get.

"David" <ri***@dd.com> wrote in message news:RzZbe.2544$iZ1.18@trnddc03...
Thanks for the reply it does help but I do understand the code more or
less.
Yes, I am new to .Net and I have studied the documentation on the
Microsoft
site and can not find anything amiss in the code. Also, I'm not a C#
programmer, I am a Javascript programmer and there are times I even need
help with the js code but not very often. Granted the languages 'are'
different but mostly in the syntax.

I will take your suggestion though and do some more research of course.
Just
hoping someone here that is more profecient in the .Net framework could
lend
a hand or spot something obvious. This is what the forum is for no?

David

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:em**************@TK2MSFTNGP12.phx.gbl...
The problem is, you used code you didn't understand. My advice would be
to
study it, keep the .Net SDK handy, study it until you own it, and when
you
understand it all of your problems will go away. In addition, the next

time
you run into a similar (but not the same) problem, you will be able to

write
your own solution straight out of your head.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
What You Seek Is What You Get.

"David" <ri***@dd.com> wrote in message

news:rlCbe.8158$yc.1063@trnddc04...
> Any guesses, shots in the dark?
>
> David
>
>
>
>
> "David" <ri***@dd.com> wrote in message
> news:yTvbe.1337$vj1.382@trnddc01...
>> Greetings all,
>>
>> I am having a problem with an asp.net application using C# which is a >> thumbnail generator. Here is the code used...
>>
>> http://www.eggheadcafe.com/articles/20030515.asp
>>
>> It works fine for .jpg images but for some reason it doesn't work with > .gif
>> images. The author of the article says it works fine for him but I

can't
> get
>> it to work. I was wondering if anyone here can shed some light?
>>
>> I have my permissions set for read, write, etc.. and as I said it
>> works
> fine
>> for jpg's.
>>
>> Thanks, David
>>
>>
>
>



Nov 19 '05 #6
Hi David,

I have the time for anyone who sticks with me, and show the kind of
discipline that you do! And I did take a look.

I may be a bit confused, as there are 2 functions on the page, so maybe I'm
misunderstanding the code you provided. But it looks to me like the Page
code you posted performs one task and then Redirects to another page.

My suspicion is that this other page somehow includes the second function in
your code page, since you say that your app "works" with GIFs but not with
JPGs. So, apparently there is some of the puzzle missing. But I do follow
the basic logic of the code you did post. And I compared it to the tutorial
you found. Looks like you followed it well. It also looks like the tutorial
was written by a VB developer who learned C#. You just can't trust the
language any more these days as an indicator of the skill level of the
developer.

The fellow who wrote the tutorial may not have had trouble because of the
types of JPGs he is using. JPGs can be a bit tricky, and his code will NOT
work for all of them.

I had a similar problem a couple of years ago when developing an Imaging
class called "ImageMaker." I created a base class (ImageMakerBase) that
would handle the common functionality, such as saving the image to a file,
or writing it out to an ASPX page.

Probably the easiest thing for me to do at this point would be to simply
post the code that saves the image, and the relevant enum and namespaces
that it uses. I'm positive that you can adapt this code as well, and let me
know if you have any trouble using it. It has performed well for me for the
past 2 years.

Note also that "_ImageObject" is a Bitmap, which I used in this class to
store and manipulate the Image. The "HandleError()" method is simply a
method that logs the exception, and you can replace it with anything you
like. _QualityPercentage is simply a quality factor that you will probably
use 100 for. Also, the additional "cloning" of the image is for the purpose
that the _ImageObject remains in the class after saving.

using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
using System.IO;

....

public enum ImageTypesEnum
{
BMP = 0,
JPG,
GIF,
PNG,
BMP_TRANSP
}
....

/// <summary>
/// Saves the Image to a file
/// </summary>
/// <param name="ImageType">Type of image file to save to</param>
/// <param name="strPath">Path to save image to</param>
public virtual void SaveToFile(string strPath, bool blnOverWrite)
{
EncoderParameters objEncoderParameters;
Bitmap b = null;
Graphics g = null;
long l = 24L;

ImageCodecInfo objImageCodecInfo;
try
{
if (File.Exists(strPath))
{
if (!blnOverWrite)
throw new Exception("File '" + strPath + "' exists, and blnOverWrite
is False. Unable to OverWrite.");
File.Delete(strPath);
}
switch (_ImageType)
{
default:
objImageCodecInfo = GetEncoderInfo("image/jpeg");
break;
case ImageTypesEnum.GIF:
objImageCodecInfo = GetEncoderInfo("image/gif");
break;
case ImageTypesEnum.BMP_TRANSP:
case ImageTypesEnum.BMP:
objImageCodecInfo = GetEncoderInfo("image/bmp");
_QualityPercentage = 100;
break;
case ImageTypesEnum.PNG:
objImageCodecInfo = GetEncoderInfo("image/png");
break;
}
if (_ImageType == ImageTypesEnum.BMP_TRANSP)
l = 32L;
objEncoderParameters = new EncoderParameters(3);
objEncoderParameters.Param[0] = new
EncoderParameter(Encoder.Compression, (long)EncoderValue.CompressionNone);
objEncoderParameters.Param[1] = new EncoderParameter(Encoder.Quality,
(long)_QualityPercentage);
objEncoderParameters.Param[2] = new EncoderParameter(Encoder.ColorDepth,
l);

if (_ImageType == ImageTypesEnum.BMP_TRANSP)
b = new Bitmap(_ImageObject.Width, _ImageObject.Height,
PixelFormat.Format32bppArgb);
else
b = new Bitmap(_ImageObject.Width, _ImageObject.Height,
PixelFormat.Format24bppRgb);
g = Graphics.FromImage(b);
g.DrawImage(_ImageObject, 0,0);
b.Save(strPath, objImageCodecInfo, objEncoderParameters);
}
catch (Exception E)
{
HandleError(E);
}
finally
{
if (g != null) g.Dispose();
if (b != null) b.Dispose();
}
}

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"David" <ri***@dd.com> wrote in message news:3K9ce.13912$Nc.94@trnddc09...
I gave a link to the original article because it supposedly works, but not
for me. Here is a link to my code which is simpler.

http://mysite.verizon.net/res8xvny/temp2/theCcode.htm

As I said, it works wonderfully for .jpg's but not for .gif's.

I don't disagree with your methodology as it works for me too, but after
too
many hours one seeks a fresh eyeball on the problem. Hence my post. If you
don't have the time to take a look, I understand, no problem. I'm just
asking here on the forum and if anyone has an idea.

David

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:Oo****************@TK2MSFTNGP09.phx.gbl...
You're on the right track, David. Unfortunately, you didn't post your

code.
You only posted the link to the article and its code. I don't have the

time
to debug the article's code, and make sure that the problem isn't there.

So
I gave you a methodology that has always worked for me.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
What You Seek Is What You Get.

"David" <ri***@dd.com> wrote in message
news:RzZbe.2544$iZ1.18@trnddc03...
> Thanks for the reply it does help but I do understand the code more or
> less.
> Yes, I am new to .Net and I have studied the documentation on the
> Microsoft
> site and can not find anything amiss in the code. Also, I'm not a C#
> programmer, I am a Javascript programmer and there are times I even
> need
> help with the js code but not very often. Granted the languages 'are'
> different but mostly in the syntax.
>
> I will take your suggestion though and do some more research of course.
> Just
> hoping someone here that is more profecient in the .Net framework could
> lend
> a hand or spot something obvious. This is what the forum is for no?
>
> David
>
>
>
>
>
> "Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
> news:em**************@TK2MSFTNGP12.phx.gbl...
>> The problem is, you used code you didn't understand. My advice would
>> be
>> to
>> study it, keep the .Net SDK handy, study it until you own it, and when
>> you
>> understand it all of your problems will go away. In addition, the next
> time
>> you run into a similar (but not the same) problem, you will be able to
> write
>> your own solution straight out of your head.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> .Net Developer
>> What You Seek Is What You Get.
>>
>> "David" <ri***@dd.com> wrote in message
> news:rlCbe.8158$yc.1063@trnddc04...
>> > Any guesses, shots in the dark?
>> >
>> > David
>> >
>> >
>> >
>> >
>> > "David" <ri***@dd.com> wrote in message
>> > news:yTvbe.1337$vj1.382@trnddc01...
>> >> Greetings all,
>> >>
>> >> I am having a problem with an asp.net application using C# which is a >> >> thumbnail generator. Here is the code used...
>> >>
>> >> http://www.eggheadcafe.com/articles/20030515.asp
>> >>
>> >> It works fine for .jpg images but for some reason it doesn't work with >> > .gif
>> >> images. The author of the article says it works fine for him but I
> can't
>> > get
>> >> it to work. I was wondering if anyone here can shed some light?
>> >>
>> >> I have my permissions set for read, write, etc.. and as I said it
>> >> works
>> > fine
>> >> for jpg's.
>> >>
>> >> Thanks, David
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Nov 19 '05 #7
Kevin,

Thanks for the explanation. I modified the original code to suit my
spplication. Basically the C# code ( aspx page ) just creates thumbnails
from the originals, creates and places the thumbs inside of thier own
folder. When it is done, it redirects to an asp page where some VB and JS
code processes it into an image gallery with all the bells and whistles.

There is no problem in the latter, of processing the images and thumbs into
the gallery and displaying them on the page. I hand wrote all of that.

Thanks for the code you posted. I'll need some time to wrap my head around
what you have done and adapt it to my purpose. I will post back with how I
make out.

Thanks again for your time and help.

David

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:e$*************@TK2MSFTNGP15.phx.gbl...
Hi David,

I have the time for anyone who sticks with me, and show the kind of
discipline that you do! And I did take a look.

I may be a bit confused, as there are 2 functions on the page, so maybe I'm misunderstanding the code you provided. But it looks to me like the Page
code you posted performs one task and then Redirects to another page.

My suspicion is that this other page somehow includes the second function in your code page, since you say that your app "works" with GIFs but not with
JPGs. So, apparently there is some of the puzzle missing. But I do follow
the basic logic of the code you did post. And I compared it to the tutorial you found. Looks like you followed it well. It also looks like the tutorial was written by a VB developer who learned C#. You just can't trust the
language any more these days as an indicator of the skill level of the
developer.

The fellow who wrote the tutorial may not have had trouble because of the
types of JPGs he is using. JPGs can be a bit tricky, and his code will NOT
work for all of them.

I had a similar problem a couple of years ago when developing an Imaging
class called "ImageMaker." I created a base class (ImageMakerBase) that
would handle the common functionality, such as saving the image to a file,
or writing it out to an ASPX page.

Probably the easiest thing for me to do at this point would be to simply
post the code that saves the image, and the relevant enum and namespaces
that it uses. I'm positive that you can adapt this code as well, and let me know if you have any trouble using it. It has performed well for me for the past 2 years.

Note also that "_ImageObject" is a Bitmap, which I used in this class to
store and manipulate the Image. The "HandleError()" method is simply a
method that logs the exception, and you can replace it with anything you
like. _QualityPercentage is simply a quality factor that you will probably
use 100 for. Also, the additional "cloning" of the image is for the purpose that the _ImageObject remains in the class after saving.

using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
using System.IO;

...

public enum ImageTypesEnum
{
BMP = 0,
JPG,
GIF,
PNG,
BMP_TRANSP
}
...

/// <summary>
/// Saves the Image to a file
/// </summary>
/// <param name="ImageType">Type of image file to save to</param>
/// <param name="strPath">Path to save image to</param>
public virtual void SaveToFile(string strPath, bool blnOverWrite)
{
EncoderParameters objEncoderParameters;
Bitmap b = null;
Graphics g = null;
long l = 24L;

ImageCodecInfo objImageCodecInfo;
try
{
if (File.Exists(strPath))
{
if (!blnOverWrite)
throw new Exception("File '" + strPath + "' exists, and blnOverWrite
is False. Unable to OverWrite.");
File.Delete(strPath);
}
switch (_ImageType)
{
default:
objImageCodecInfo = GetEncoderInfo("image/jpeg");
break;
case ImageTypesEnum.GIF:
objImageCodecInfo = GetEncoderInfo("image/gif");
break;
case ImageTypesEnum.BMP_TRANSP:
case ImageTypesEnum.BMP:
objImageCodecInfo = GetEncoderInfo("image/bmp");
_QualityPercentage = 100;
break;
case ImageTypesEnum.PNG:
objImageCodecInfo = GetEncoderInfo("image/png");
break;
}
if (_ImageType == ImageTypesEnum.BMP_TRANSP)
l = 32L;
objEncoderParameters = new EncoderParameters(3);
objEncoderParameters.Param[0] = new
EncoderParameter(Encoder.Compression, (long)EncoderValue.CompressionNone);
objEncoderParameters.Param[1] = new EncoderParameter(Encoder.Quality,
(long)_QualityPercentage);
objEncoderParameters.Param[2] = new EncoderParameter(Encoder.ColorDepth, l);

if (_ImageType == ImageTypesEnum.BMP_TRANSP)
b = new Bitmap(_ImageObject.Width, _ImageObject.Height,
PixelFormat.Format32bppArgb);
else
b = new Bitmap(_ImageObject.Width, _ImageObject.Height,
PixelFormat.Format24bppRgb);
g = Graphics.FromImage(b);
g.DrawImage(_ImageObject, 0,0);
b.Save(strPath, objImageCodecInfo, objEncoderParameters);
}
catch (Exception E)
{
HandleError(E);
}
finally
{
if (g != null) g.Dispose();
if (b != null) b.Dispose();
}
}

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
What You Seek Is What You Get.

"David" <ri***@dd.com> wrote in message news:3K9ce.13912$Nc.94@trnddc09...
I gave a link to the original article because it supposedly works, but not for me. Here is a link to my code which is simpler.

http://mysite.verizon.net/res8xvny/temp2/theCcode.htm

As I said, it works wonderfully for .jpg's but not for .gif's.

I don't disagree with your methodology as it works for me too, but after
too
many hours one seeks a fresh eyeball on the problem. Hence my post. If you don't have the time to take a look, I understand, no problem. I'm just
asking here on the forum and if anyone has an idea.

David

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:Oo****************@TK2MSFTNGP09.phx.gbl...
You're on the right track, David. Unfortunately, you didn't post your

code.
You only posted the link to the article and its code. I don't have the

time
to debug the article's code, and make sure that the problem isn't there.
So
I gave you a methodology that has always worked for me.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
What You Seek Is What You Get.

"David" <ri***@dd.com> wrote in message
news:RzZbe.2544$iZ1.18@trnddc03...
> Thanks for the reply it does help but I do understand the code more
or > less.
> Yes, I am new to .Net and I have studied the documentation on the
> Microsoft
> site and can not find anything amiss in the code. Also, I'm not a C#
> programmer, I am a Javascript programmer and there are times I even
> need
> help with the js code but not very often. Granted the languages 'are'
> different but mostly in the syntax.
>
> I will take your suggestion though and do some more research of course. > Just
> hoping someone here that is more profecient in the .Net framework could > lend
> a hand or spot something obvious. This is what the forum is for no?
>
> David
>
>
>
>
>
> "Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
> news:em**************@TK2MSFTNGP12.phx.gbl...
>> The problem is, you used code you didn't understand. My advice would
>> be
>> to
>> study it, keep the .Net SDK handy, study it until you own it, and when >> you
>> understand it all of your problems will go away. In addition, the next > time
>> you run into a similar (but not the same) problem, you will be able to > write
>> your own solution straight out of your head.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> .Net Developer
>> What You Seek Is What You Get.
>>
>> "David" <ri***@dd.com> wrote in message
> news:rlCbe.8158$yc.1063@trnddc04...
>> > Any guesses, shots in the dark?
>> >
>> > David
>> >
>> >
>> >
>> >
>> > "David" <ri***@dd.com> wrote in message
>> > news:yTvbe.1337$vj1.382@trnddc01...
>> >> Greetings all,
>> >>
>> >> I am having a problem with an asp.net application using C# which is a
>> >> thumbnail generator. Here is the code used...
>> >>
>> >> http://www.eggheadcafe.com/articles/20030515.asp
>> >>
>> >> It works fine for .jpg images but for some reason it doesn't work

with
>> > .gif
>> >> images. The author of the article says it works fine for him but

I > can't
>> > get
>> >> it to work. I was wondering if anyone here can shed some light?
>> >>
>> >> I have my permissions set for read, write, etc.. and as I said it
>> >> works
>> > fine
>> >> for jpg's.
>> >>
>> >> Thanks, David
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Nov 19 '05 #8
Kevin,
I may be a bit confused, as there are 2 functions on the page, so maybe I'm misunderstanding the code you provided. But it looks to me like the Page
code you posted performs one task and then Redirects to another page.
To clarify, Yes, there are 2 functions. The second function ( public void
GenerateThumbNail ) is the code that actually generates the thumbnails. The
first function ( public void GenerateThumbNailImagesForFolder ) creates the
folder necessary for the thumbs and as well provides the path to the
originals, as well as the type of image for the ( public void
GenerateThumbNail ). This seems a fairly logical approach to me.

My suspicion is that this other page somehow includes the second function in your code page, since you say that your app "works" with GIFs but not with
JPGs.


Actually it works with all JPGs I have tried, but not GIFs. That is the
problem.

Anyway, I will work with the code you posted and see how I can make out with
that.

David


Nov 19 '05 #9
Hi David,

GIFs also can differ in several ways. For example, a GIF can have a pallette
of anywhere from 1 to 255 colors.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"David" <ri***@dd.com> wrote in message news:WQcce.14232$Nc.1196@trnddc09...
Kevin,
I may be a bit confused, as there are 2 functions on the page, so maybe

I'm
misunderstanding the code you provided. But it looks to me like the Page
code you posted performs one task and then Redirects to another page.


To clarify, Yes, there are 2 functions. The second function ( public void
GenerateThumbNail ) is the code that actually generates the thumbnails.
The
first function ( public void GenerateThumbNailImagesForFolder ) creates
the
folder necessary for the thumbs and as well provides the path to the
originals, as well as the type of image for the ( public void
GenerateThumbNail ). This seems a fairly logical approach to me.

My suspicion is that this other page somehow includes the second function

in
your code page, since you say that your app "works" with GIFs but not
with
JPGs.


Actually it works with all JPGs I have tried, but not GIFs. That is the
problem.

Anyway, I will work with the code you posted and see how I can make out
with
that.

David


Nov 19 '05 #10
Correction: 256 colors!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"David" <ri***@dd.com> wrote in message news:WQcce.14232$Nc.1196@trnddc09...
Kevin,
I may be a bit confused, as there are 2 functions on the page, so maybe

I'm
misunderstanding the code you provided. But it looks to me like the Page
code you posted performs one task and then Redirects to another page.


To clarify, Yes, there are 2 functions. The second function ( public void
GenerateThumbNail ) is the code that actually generates the thumbnails.
The
first function ( public void GenerateThumbNailImagesForFolder ) creates
the
folder necessary for the thumbs and as well provides the path to the
originals, as well as the type of image for the ( public void
GenerateThumbNail ). This seems a fairly logical approach to me.

My suspicion is that this other page somehow includes the second function

in
your code page, since you say that your app "works" with GIFs but not
with
JPGs.


Actually it works with all JPGs I have tried, but not GIFs. That is the
problem.

Anyway, I will work with the code you posted and see how I can make out
with
that.

David


Nov 19 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Francis Avila | last post by:
A little annoyed one day that I couldn't use the statefulness of generators as "resumable functions", I came across Hettinger's PEP 288 (http://www.python.org/peps/pep-0288.html, still listed as...
4
by: Wai Yip Tung | last post by:
I'm attempting to turn some process than uses callback to return result into a more user friendly generator. I'm hitting some road block so any pointer would be appriciated. Let say there is an...
1
by: Johnny | last post by:
Hello, I am looking for someone to guide me in the right direction. What I want to do is take a "screenshot" of a web page programatically as IE sees it, using C#? I had previosuly used the...
8
by: Chris Dewin | last post by:
Hi. I run a website for my band, and the other guys want an image gallery. I'm thinking it would be nice and easy, if we could just upload a jpg into a dir called "gallery/". When the client...
0
by: Vicky | last post by:
HI , i have made a thumbnail generator webservice. Its free and anyone can access it from http://www.indiaresult.com/webservice/thumbnailgenerator.asmx Vicky
1
by: David Lozzi | last post by:
Hello, I'm wondering whats the best method to use for displaying several photos' thumbnails. One method I know is to dynamically resize the photo at the time the page is loaded. What does this...
1
by: Xah Lee | last post by:
The following is a program to generate thumbnail images for a website. Useful, if you want to do that. It is used to generate the thumbnails for my “Banners, Damsels, and Mores” project...
1
by: Summercoolness | last post by:
In PIL, since thumbnail() first makes a draft copy of the image, and then resize it, so thumbnail() can run a lot faster than resize() because draft() seems a lot faster when resizing from very big...
7
by: flamer die.spam | last post by:
Hi all, I have a new website im setting up, its a large image archive, I have it setup to open a folder, go through and for each file in that folder check a /tn sub-folder for a matching name, if...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shllpp 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.