Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • ssalmon 8 posts 27 karma points
    Feb 17, 2011 @ 10:10
    ssalmon
    0

    Major issue with images not resizing

    Hello. I am facing bit of a nasty problem with the latest release of imagegen 2.5. I have attached a screenshot from a photogallery application that I have written, however, as you can see some images appear to not be resized. I would say that over around 300 images around 10 may not get resized resulting in the cache file remaining resident. If I clear the cache files down the the same image generally get's resized correctly. Totally random.

    My config is the following if this helps:

    <Class Name="1_thumb" OverridesQueryString="false">

        <ImageBaseDir>account</ImageBaseDir>

        <MaxHeight>175</MaxHeight>

        <MaxWidth>175</MaxWidth>

        <Compression>75</Compression>

        <Constrain>true</Constrain>

        <NoCache>false</NoCache>

        <CachingTimeSpan>3600</CachingTimeSpan>

        <Text></Text>

      </Class>

    My calling url to the images are the following:

    ImageGen.ashx?image=/NYEPQI/images_full/img001.jpg&class=1_thumb

    I tried removing the CachingTimeSpan setting down after clearing both server and local cache but this did not make any difference. 

    I would appreciate any help to get this working.

    Regards

    Steven

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Feb 18, 2011 @ 08:34
    Douglas Robar
    0

    Thanks for the bug report. I'll look into it next week when I'm back in the office.

    Until then, can you post here or email me the macro the makes the gallery? That would help in reproducing the issue.

    cheers,
    doug.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Feb 21, 2011 @ 18:10
    Douglas Robar
    0

    I just made a macro that resizes 650 images into a lightbox-enabled photo gallery with source images from 8-21MP in size. Two images were not resized. No immediate indication why except that the machine was heavily taxed trying to resize so many at once and may have run out of memory at some point.

    This is good news, though - reproducable (after a fashion). I'll work on a simpler case and see about debugging the issue.

    Will keep you posted.

    cheers,

    doug.

     

  • ssalmon 8 posts 27 karma points
    Feb 22, 2011 @ 11:56
    ssalmon
    0

    Hi Doug

    Sorry for the late reply due to work. My source images are around 120k in size and I am dealing with about 350 with each page size of around 36. I am using a simple listview control with a usercontrol inside the template which has it's parameters passed which include all of the required properties for the image. Very simple stuff infact. I can post the code if you wish, however, it does appear that you have a sniff of something already. If you need me to perform any testing for you I am more than happy to do this for you because I can simply drop the updated imagegen in and rerun on a fresh noncached image pile. You have my email address.

    Look forward to hearing from you soon.

    Regards

    Steven

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Feb 22, 2011 @ 12:18
    Douglas Robar
    0

    Debugging is challenging because of the random nature. I'm trying to simplify my tests to reproduce it without having to chew through 4.5gig of files but so far it has only happened on my test machine with 600+ images being displayed at one time.

    Curiously, if I flush the browser's cache and reload the page (shift-reload the url) I get the properly resized image. A normal page refresh will get a 304 response and use the previously cached image on the browser but a shift-reload will force ImageGen to send the resized images, which works perfectly. As far as I can tell so far, the image is resized properly, the server cache is updated properly, but for some reason the original (rather than resized) image is sent to the browser. 

    @Steven, If you run your page with firebug or another response viewer active, you should see the 304 messages on browser reload (when the big image still appears). If you then hold the shift key and reload the page, you should see 200 responses and see the properly resized images. Do you?

    cheers,
    doug.

  • ssalmon 8 posts 27 karma points
    Feb 22, 2011 @ 17:11
    ssalmon
    0

    Hi Doug

    I am not a user of Firebug but installed it for Firefox. When I browse through the pages and I come across one which has not resized simply holding shift and doing a refresh correctly resolves the problem. I then page through and come across another with the same problem. 

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Feb 22, 2011 @ 17:25
    Douglas Robar
    0

    Hi, Steven,

    Slowly making progress. Thanks for checking; sounds like your behavior is as I expected so that's good. Now to figure out why there is an occassional problem with ImageGen sending the non-resized image. I can only sometimes recreate the problem with more than 500 21-megapixel (10MB) jpgs, all being resized at once. And even then it doesn't happen every time. Debugging is slow that way :)

    Will keep you posted.

    cheers,
    doug.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Feb 23, 2011 @ 00:40
    Douglas Robar
    0

    I'm narrowing in on the problem and may at least have a short-term workaround for you.

    Can you add the following to your class to specify the width and height (in addition to maxwidth and maxheight)? That should (*should*) sort it out. 

    <Width>175</Width>
    <Height>175</Height>

    You might also want to specify <AllowUpSizing>false</AllowUpSizing> if there's a chance your original images will be smaller than 175x175 and you don't want ImageGen to enlarge them. Probably not a concern even if upsized since 175 is so small.

    Let me know if setting width and height makes a difference for you.

    cheers,
    doug.

  • ssalmon 8 posts 27 karma points
    Feb 23, 2011 @ 09:22
    ssalmon
    0

    Hi Doug

    Thanks for the reply. I have just tried this and it still is exactly the same. My config is now:

     

      <Class Name="1_thumb" OverridesQueryString="false">
        <ImageBaseDir>account</ImageBaseDir>
        <MaxHeight>175</MaxHeight>
        <MaxWidth>175</MaxWidth>
        <Width>175</Width>
        <Height>175</Height>
        <AllowUpSizing>false</AllowUpSizing>
        <Compression>75</Compression>
        <Constrain>true</Constrain>
        <NoCache>false</NoCache>
        <Text></Text>
      </Class>

    The actual link into the photo is very simple:

    imgPhoto.ImageUrl = "../../ImageGen.ashx?image=" & PhotoPath & FileName & "&class=1_thumb"

    The actual user control calling code is:

     

        <asp:Panel runat="server" ID="pnlPhotoGridContainer">
            <asp:ListView ID="lvPhotos" runat="server" DataKeyNames="imageid" DataSourceID="PagerDataSource1" GroupItemCount="3">
                <LayoutTemplate>
                    <table cellpadding="0" cellspacing="2" runat="server" id="tblPhotos" width="100%" style="border-left: 1px solid #CFCFCF; border-right: 1px solid #CFCFCF; border-bottom: 1px solid #CFCFCF;" >
                        <tr runat="server" ID="groupPlaceholder"></tr>
                    </table>
                </LayoutTemplate>
                <GroupTemplate>
                    <tr runat="server" id="photoRow" style="height: 230px;">
                        <td runat="server" id="itemPlaceholder"></td>
                    </tr>
                </GroupTemplate>
                <ItemTemplate>
                    <td id="Td3" valign="middle" align="center" style="width:300px; background-color: #F4F4F4;" runat="server">
                        <table cellpadding="0" cellspacing="0" border="0" width="100%">
                            <tr>
                                <td valign="middle" align="center" style="height: 200px;">
                                    <mow:control_galleryphotosmall ID="control_galleryphotosmall" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td  valign="middle" align="center" style="height: 30px; background-color: #E8E8E8;">
                                    <div style="text-align: left;">
                                        <div style="width: 100px; font-family: Tahoma; font-size: 0.8em; float: left;">
                                            <span style="margin-left: 5px;"><%# StripExtension(DataBinder.Eval(Container.DataItem, "imagefilename"))%></span>
                                        </div>
                                        <div style="width: 100px; float: right; text-align: right; margin-right: 3px; margin-top: 2px;">
                                        <asp:HyperLink runat="server" ID="lnkPhoto" Visible="false">
                                            <asp:Image runat="server" ID="imgComments" ImageUrl="../images/icons/icon_comments.png" Visible="false" style="cursor:pointer" />
                                        </asp:HyperLink>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </td>
                </ItemTemplate>
                <EmptyItemTemplate>
                <td id="Td4" valign="middle" align="center" style="width:300px; background-color: #F4F4F4;" runat="server">
                    &nbsp;
                </td>
                </EmptyItemTemplate>
            </asp:ListView>    
        </asp:Panel>

     

     

    I have some code behind which applies properties to the user control during binding which are simply passed down to the control. Nothing special here.

    I hope this helps Doug. 

     

     

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Feb 23, 2011 @ 09:26
    Douglas Robar
    0

    Well, there goes that late-night idea! :)

    Thanks for trying the width/height settings and also for the code you're using. I'll keep at it and let you know what I find. Now for coffee and more debugging.

    cheers,
    doug.

  • ssalmon 8 posts 27 karma points
    Feb 23, 2011 @ 09:29
    ssalmon
    0

    Doug also just to let you know that I also get the problem when I am only displaying 6 photos to a page. I simply dropped my paging down to display only 6 per page and eventually it happened on about the 30th page. I was paging through quite quickly.

  • ssalmon 8 posts 27 karma points
    Feb 23, 2011 @ 09:35
    ssalmon
    0

    Cheers Doug. Just emailed you a private link to show you the effect.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Feb 23, 2011 @ 09:47
    Douglas Robar
    0

    Thanks, Steve, it's helpful to see it insitu. Very nice work on the site, by the way!

    cheers,
    doug.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Feb 23, 2011 @ 11:29
    Douglas Robar
    0

    I think I've found and fixed the problem. I'll email you a new dll shortly for you to test.

  • Nic 4 posts 24 karma points
    Mar 03, 2011 @ 02:58
    Nic
    0

    Hi Doug,

    I am currently experiencing the same issue with a website I'm working on.  Images randomly not being resized at random page loads.

    Did you manage to resolve the issue with the new dll?  If so, is it possible to grab a copy of the dll file.

  • ssalmon 8 posts 27 karma points
    Mar 03, 2011 @ 10:50
    ssalmon
    0

    Nic

    Yes Doug has resolved this issue and posted 2.5.1 release of the DLL which you can download.

    Regards

    Steven

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Mar 03, 2011 @ 14:07
    Douglas Robar
    1

    Right, ImageGen 2.5.1 fixes that bug. You can download it from the projects section or the Package Repository. Follow upgrade instructions or (for v2.5 to v2.5.1, copy the imagegen.dll out of the zip file and put it into your site's /bin folder). You will want to delete the 'cached' folders in either case though.

    cheers,
    doug.

  • Nic 4 posts 24 karma points
    Mar 03, 2011 @ 23:40
    Nic
    0

    Awesome!  Thanks!

Please Sign in or register to post replies

Write your reply to:

Draft