MaxImageWidth has no effect

Last post 12-05-2010, 8:12 PM by Kenneth. 5 replies.
Sort Posts: Previous Next
  •  11-25-2010, 10:53 PM 65167

    MaxImageWidth has no effect

    Hi,
     
    When viewing the full size image, they always display at 576x385 no matter what I do.  I'm setting MaxImageWidth and MaxImageHeight, but it has no effect what so ever.  My images are all 800x534 so I have:
     
    <dotnetgallery:gallerybrowser id="dotnetgallery1" GalleryFolder="~/images/2010/" runat="server" Layout="gridshow" Width="600" AllowPostComment="true" MaxImageWidth="800" MaxImageHeight="534" />
     
    But the images still display at 576x385.  Any ideas?
     
    Thanks!
     
    Casey
  •  11-26-2010, 8:42 AM 65172 in reply to 65167

    Re: MaxImageWidth has no effect

    Dear Casey,
     
    I tested this scenario based on the following code:
     

    <%@ Page language="c#" AutoEventWireup="false" %>
    <%@ Register TagPrefix="DotNetGallery" Namespace="DotNetGallery" Assembly="DotNetGallery" %>
    <script runat="server">
    protected override void OnInit(EventArgs e)
    {
     base.OnInit(e);

    // if(Context.User.Identity.Name=="Admin")
    // {
      GalleryBrowser1.AllowEdit=true;
      GalleryBrowser1.AllowPostComment=true;
      GalleryBrowser1.AllowShowComment=true;
    // }
    }
    </script>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
     <head>
     
     </head>
     <body>
      <form id="form1" runat="server">
       <div id="Common">
        <div id="CommonBody" align="center">
         <div align="right" style="margin: 0 30px 5px 0">
         <%if(GalleryBrowser1.AllowEdit){%>
          <a href="#" onclick="thegallerybrowser.ShowEditor();return false;">Admin Console</a> |
         <%}%>
          <a href="#" onclick="thegallerybrowser.ShowSlider();return false;">Start slide show</a>
         </div>
         <dotnetgallery:gallerybrowser runat="server" id="GalleryBrowser1" MaxImageWidth="1024" MaxImageHeight="768" Width="780" Height="400" />
        </div>    
       </div>
      </form>
     </body>
    </html>

    It works fine on my end.
    Can you check your DotNetGallery version? What's the build date of "DotnetGallery.dll"?
     
    Thank you for asking
  •  11-26-2010, 9:24 AM 65173 in reply to 65172

    Re: MaxImageWidth has no effect

    Thank you for the quick reply.

    I downloaded v3.1 from this location: http://cutesoft.net/downloads/folders/gallery_current_releases/entry21926.aspx
     
    Right now I'm not doing anything fancy until I get this solved.  All I've got is this:
     
    <dotnetgallery:gallerybrowser id="dotnetgallery1" Visible="false" GalleryFolder="~/images/1_Family/2009/" runat="server" Layout="gridshow" Width="600" AllowPostComment="true" MaxImageWidth="1024" MaxImageHeight="768" />
     
    And the image still shows at the small size and not the actual size of the image. Am I using the wrong version?
  •  11-26-2010, 10:33 AM 65174 in reply to 65173

    Re: MaxImageWidth has no effect

    Dear ccrookston ,
     
    Please change
    <dotnetgallery:gallerybrowser id="dotnetgallery1" Visible="false" GalleryFolder="~/images/1_Family/2009/" runat="server" Layout="gridshow" Width="600" AllowPostComment="true" MaxImageWidth="1024" MaxImageHeight="768" />
    to
    <dotnetgallery:gallerybrowser id="GalleryBrowser1" GalleryFolder="~/images/1_Family/2009/" runat="server" Layout="gridshow" Width="600" AllowPostComment="true" MaxImageWidth="555" MaxImageHeight="333" />
    and try it again.
    I uploaded two files which are 1024*768, all are changed to 555*333 after uploaded.
     
    Thank you for your business
  •  11-26-2010, 12:04 PM 65175 in reply to 65174

    Re: MaxImageWidth has no effect

    Eric:
    I uploaded two files which are 1024*768, all are changed to 555*333 after uploaded.
     
    Hi Eric,
     
    I'm not having any trouble making the images smaller.  It's making them the same size as the original image that seems to be the problem.  All of my images are 800x534, and I want them to display at exactly that size.   At first I tried this:
     
    <dotnetgallery:gallerybrowser id="dotnetgallery1" GalleryFolder="~/images/2010/" runat="server" Layout="gridshow" Width="600" AllowPostComment="true" MaxImageWidth="800" MaxImageHeight="534" />
     
    But it still displayed the images at 576x385.  Please try uploading images that are  800x535 and then displaying them in the popup at that exact size. 
     
    What would be perfect is an attribute called something like ResizeImage, which, when set to false, leaves the images at their original size with
    absolutely no resizing at all.  "MaxImage....." seems to imply that it won't let the image go any larger than that size, but it won't necessarily force the image to be that size either.  This is really a great gallery tool, but I'd like more control over the size of my images when displayed on screen.  When I upload them, they are already exactly how I want them to be displayed and I'd love it if this gallery tool didn't second guess what I've already done.
     
    Thanks,
     
    Casey
  •  12-05-2010, 8:12 PM 65286 in reply to 65175

    Re: MaxImageWidth has no effect

    Hi ccrookston,
     
    Try this way
     
    1. Open file "CuteSoft_Client\Gallery\Viewer\LightBox\Code.js "
     
    2. Find section below
     
    var imgwidth=Math.floor(photo.Width*scale);
    var imgheight=Math.floor(photo.Height*scale);
     
    3. Change to
     
    var imgwidth=Math.floor(photo.Width*);
    var imgheight=Math.floor(photo.Height);
     
    4. Find section below
     
    this.frame.onclick=ToDelegate(this,function(event){
            ShowPrevNext(event);
            if(this.prevbtn.style.display=="")
            {
                var p=this.GetPrevPhoto(photo);
                if(p)this.Show(p);
            }
            if(this.nextbtn.style.display=="")
            {
                var p=this.GetNextPhoto(photo);
                if(p)this.Show(p);
            }
        });
     
     
    5. Change to
     
        this.frame.onclick=ToDelegate(this,function(event){
            if(this.prevbtn.style.display=="")
            {
                var p=this.GetPrevPhoto(photo);
                if(p)this.Show(p);
            }
            if(this.nextbtn.style.display=="")
            {
                var p=this.GetNextPhoto(photo);
                if(p)this.Show(p);
            }
        });
     
    Regards,
     
    ken
View as RSS news feed in XML