C# ASP.NET Thumbnail Generator issue

Discussion in 'ASP .Net' started by David, Apr 26, 2005.

  1. David

    David Guest

    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
    David, Apr 26, 2005
    #1
    1. Advertising

  2. David

    David Guest

    Any guesses, shots in the dark?

    David




    "David" <> 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
    >
    >
    David, Apr 27, 2005
    #2
    1. Advertising

  3. 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" <> wrote in message news:rlCbe.8158$yc.1063@trnddc04...
    > Any guesses, shots in the dark?
    >
    > David
    >
    >
    >
    >
    > "David" <> 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
    >>
    >>

    >
    >
    Kevin Spencer, Apr 27, 2005
    #3
  4. David

    David Guest

    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" <> wrote in message
    news:...
    > 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" <> wrote in message

    news:rlCbe.8158$yc.1063@trnddc04...
    > > Any guesses, shots in the dark?
    > >
    > > David
    > >
    > >
    > >
    > >
    > > "David" <> 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
    > >>
    > >>

    > >
    > >

    >
    >
    David, Apr 28, 2005
    #4
  5. 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" <> 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" <> wrote in message
    > news:...
    >> 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" <> wrote in message

    > news:rlCbe.8158$yc.1063@trnddc04...
    >> > Any guesses, shots in the dark?
    >> >
    >> > David
    >> >
    >> >
    >> >
    >> >
    >> > "David" <> 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
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >
    Kevin Spencer, Apr 28, 2005
    #5
  6. David

    David Guest

    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" <> wrote in message
    news:OoZdn5%...
    > 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" <> 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" <> wrote in message
    > > news:...
    > >> 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" <> wrote in message

    > > news:rlCbe.8158$yc.1063@trnddc04...
    > >> > Any guesses, shots in the dark?
    > >> >
    > >> > David
    > >> >
    > >> >
    > >> >
    > >> >
    > >> > "David" <> 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
    > >> >>
    > >> >>
    > >> >
    > >> >
    > >>
    > >>

    > >
    > >

    >
    >
    David, Apr 28, 2005
    #6
  7. 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" <> 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" <> wrote in message
    > news:OoZdn5%...
    >> 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" <> 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" <> wrote in message
    >> > news:...
    >> >> 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" <> wrote in message
    >> > news:rlCbe.8158$yc.1063@trnddc04...
    >> >> > Any guesses, shots in the dark?
    >> >> >
    >> >> > David
    >> >> >
    >> >> >
    >> >> >
    >> >> >
    >> >> > "David" <> 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
    >> >> >>
    >> >> >>
    >> >> >
    >> >> >
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >
    Kevin Spencer, Apr 28, 2005
    #7
  8. David

    David Guest

    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" <> wrote in message
    news:e$qf$...
    > 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" <> 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" <> wrote in message
    > > news:OoZdn5%...
    > >> 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" <> 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" <> wrote in message
    > >> > news:...
    > >> >> 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" <> wrote in message
    > >> > news:rlCbe.8158$yc.1063@trnddc04...
    > >> >> > Any guesses, shots in the dark?
    > >> >> >
    > >> >> > David
    > >> >> >
    > >> >> >
    > >> >> >
    > >> >> >
    > >> >> > "David" <> 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
    > >> >> >>
    > >> >> >>
    > >> >> >
    > >> >> >
    > >> >>
    > >> >>
    > >> >
    > >> >
    > >>
    > >>

    > >
    > >

    >
    >
    David, Apr 28, 2005
    #8
  9. David

    David Guest

    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
    David, Apr 28, 2005
    #9
  10. 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" <> 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
    >
    >
    >
    >
    >
    >
    Kevin Spencer, Apr 29, 2005
    #10
  11. Correction: 256 colors!

    --
    HTH,

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

    "David" <> 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
    >
    >
    >
    >
    >
    >
    Kevin Spencer, Apr 29, 2005
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Martin Maurer
    Replies:
    3
    Views:
    4,770
    Peter
    Apr 19, 2006
  2. =?Utf-8?B?YXNhZA==?=

    ASP.NET thumbnail creating and saving

    =?Utf-8?B?YXNhZA==?=, Apr 9, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    3,969
    Brock Allen
    Apr 9, 2005
  3. David Lozzi
    Replies:
    1
    Views:
    486
    john smith
    Feb 1, 2006
  4. TheDustbustr
    Replies:
    1
    Views:
    430
    Sami Hangaslammi
    Jul 25, 2003
  5. Chris Dewin

    python image thumbnail generator?

    Chris Dewin, Aug 28, 2005, in forum: Python
    Replies:
    8
    Views:
    1,088
    Damjan
    Aug 29, 2005
Loading...

Share This Page