Copied to clipboard

Flag this post as spam?

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


  • Mridul Thomas 8 posts 28 karma points
    Oct 12, 2012 @ 19:09
    Mridul Thomas
    0

    Imagegen.config settings not working

    Our website is having a paid vesrion of Imagegen. Eventhough we have set these setting in the Imagegen.config file - the result doesnt show up on the site.

     

    <Align>center</Align>

    <VAlign>middle</VAlign>

    <Constrain>true</Constrain>

    <AltImage>/images/noimage.jpg</AltImage>

    Please advice.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 12, 2012 @ 23:21
    Douglas Robar
    0

    The first thing to check is that the Professional features are enabled. For your site, visit the /imagegen.ashx?version page and be sure it says that ImageGen Professional is enabled for your domain. If it isn't, double-check that you have the proper entries in the web.config file and the domain registration key in the /config/imagegen.config file.

    Once you've confirmed that you have ImageGen Professional activated then the classes in the imagegen.config file will be available (they only work when you have Professional). If you've made the entries in the "default" class then they will be applied automatically. If you've made your own class (such as one named "Mridul") you'll need to specifically tell ImageGen to use it for a request. For example, /imagegen.ashx?image=myimage.jpg&class=Mridul

    Let me know how it goes.

    cheers,
    doug. 

  • Mridul Thomas 8 posts 28 karma points
    Oct 15, 2012 @ 08:13
    Mridul Thomas
    0

    ImageGen Basic version 2.5.7.27945
    Professional features are available for localhost
    Professional features are available for *.local

    This is what the browser is showing when I visited the /imagegen.ashx?version page. Can you please show me how to add the domain of my website.

    Also the following settings aren't working on the local development version. 

    <Align>center</Align>

    <VAlign>middle</VAlign>

    But the constrain and altimage settings are working fine.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 15, 2012 @ 09:31
    Douglas Robar
    0

    When you install ImageGen it should have added the correct entries to the web.config file and referencing the /config/imagegen.config file. The ImageGen Reference Manual PDF has instructions on how to update the web.config file manually though. 

    <configuration>

    <configSections>
    <!-- ImageGen Professional -->
    <section name="ImageGenConfiguration" type="ImageGen.ImageGenConfigurationHandler,ImageGen" />
    </configSections>

    <!-- ImageGen Professional -->
    <ImageGenConfiguration configSource="config\ImageGen.config" />

    </configuration>

     

    As for the align and valign, do they work if you set them on the querystring and not in your class?

    Note that when working on these kinds of issues it can be helpful to use the ?nocache=true parameter on the querystring to ensure ImageGen ignores any previously cached images and recreates the requested image to your specifications. Just don't use the nocache=true parameter in production because if you do you'll see your cpu and memory usage soar when every request is always regenerated afresh rather than using the cache.

    cheers,
    doug. 

     

  • Mridul Thomas 8 posts 28 karma points
    Oct 17, 2012 @ 07:18
    Mridul Thomas
    0

    The web.config is having the exact same settings that you have mentioned.

    And setting the align and valign parameters inline in the querystring also doesn't work. And adding ?nocache=true in the querystring didn't help. 

    What am I doing wrong?

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 17, 2012 @ 10:36
    Douglas Robar
    0

    It sounds like things are set up correctly.

    Can you show us your ~/config/imagegen.config file's contents?

    Any chance you could share a URL where I can see this happening myself? If you don't want to share it publicly on the forum, contact me through my website at http://www.percipientstudios.com/about/contact.aspx

    cheers,
    doug. 

  • Mridul Thomas 8 posts 28 karma points
    Oct 17, 2012 @ 11:18
    Mridul Thomas
    0

    Here is the contents of ImageGen.config

    <ImageGenConfiguration>

    <Registration>

    <!-- ImageGen Professional is always available on localhost and *.local domains -->

    <Key domain="kontorting.dk">F0DF214C6FBA4E4DF0F7A6C9017344BF3A2F1722</Key>

    </Registration>

    <HideDomains>false</HideDomains>

    <RemoteDomainWhiteList>

    <Domain>www.sample.com</Domain>

    </RemoteDomainWhiteList>

     

    <!-- FONT DEFINITIONS -->

    <Font Name="AvantGardeCE">

    <Filename Style="regular">/fonts/AGW_CE.ttf</Filename>

    <Filename Style="bold">/fonts/AGD_CE.ttf</Filename>

    <Filename Style="italic">/fonts/LTe52012.ttf</Filename>

    <Filename Style="bold, italic">/fonts/LTe52014.ttf</Filename>

    </Font>

     

    <!-- NAMED CLASSES, INCULDING THE SPECIAL 'DEFAULT' CLASS -->

    <Class Name="default" OverridesQueryString="true">

    <Align>center</Align>

    <VAlign>middle</VAlign>

    <Constrain>true</Constrain>

    <AltImage>/images/noimage.jpg</AltImage>

    <AllowUpsizing>false</AllowUpsizing>

    <MaxHeight>800</MaxHeight>

    <MaxWidth>800</MaxWidth>

    </Class>

    <Class Name="Thumbnail" OverridesQueryString="true">

    <InheritFromClass>default</InheritFromClass>

    <Width>200</Width>

    <Height>200</Height>

    <CachingTimeSpan>3600</CachingTimeSpan>

    </Class>

    <Class Name="CorporateFont" OverridesQueryString="true">

    <Font>AvantGardeCE</Font>

    <FontColor>000000</FontColor>

    </Class>

    <Class Name="LargeHeading" OverridesQueryString="true">

    <InheritFromClass>CorporateFont</InheritFromClass>

    <FontSize>53</FontSize>

    <FontColor>c6ff00</FontColor>

    <BgColor>76c11a</BgColor>

    <BoldOffset>1</BoldOffset>

    </Class>

     

    <!-- FOLDER CLASSES -->

    <Class Folder="/myproducts" OverridesQueryString="true">

    <Height>100</Height>

    </Class>

    <Class Folder="[test|demo]folder" OverridesQueryString="true">

    <Border>10</Border>

    <Bordercolor>red</Bordercolor>

    </Class>

    </ImageGenConfiguration>

    I've also messaged you regarding the URL. 
  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 17, 2012 @ 14:41
    Douglas Robar
    0

    Thanks for getting me access to your staging site.

    When I visit the /imagegen.ashx?version page I see the following (domain obfuscated), which is correct and shows you have the web.config and imagegen.config files properly set up:

    ImageGen Professional version 2.5.7.27945
    Professional features are available for localhost
    Professional features are available for *.local
    Professional features are available for yourdomain.com

     

    I also see the Align and VAlign settings working properly. For instance, this request puts the text in the middle of the image. It's in the middle because the 'default' class in your imagegen.config sets it that way.

    /ImageGen.ashx?text=hi&width=400&height=400

     

    I can't verify that changing the Align and Valign settings works because the default class has the OverridesQueryString="true" setting. Which means even if I set &align=right&valign=bottom on the querystring command they will be ignored because the settings for align and valign in the class will override those on the querystring. But I've confirmed the settings work properly on a local installation.

    cheers,
    doug. 

     

  • Mridul Thomas 8 posts 28 karma points
    Oct 18, 2012 @ 06:38
    Mridul Thomas
    0

    Thanks for checking the website. I thought that setting the Align and Valign parameters would place the image according to the container div. By reading your comment i understand that these parameters are used to align the text only.

    Sorry that i've misunderstood this. But is there any way to aling the image as a whole instead of the text. 

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 18, 2012 @ 09:21
    Douglas Robar
    0

    Your html/css design is responsible for its own markup around images. ImageGen can do a lot but only within the confines of the image that is generated.

     If you want to take a product image (which might be any size and either landscape or portrait orientation), for instance, and resize it to fit on a page of product thumbnail images that are all a certain size (let's say 200x200px) and the resized image should be as large as possible in that space without any cropping, centered within the space, and on a white background, you can do that with:

    imagegen.ashx?image=product.jpg&width=200&height=200&pad=true&align=center&valign=middle&bgcolor=FFFFFF

    You might need some css rules as well, but at least you can be sure that all product images on this page would be 200x200, on a white background, and be centered within the resulting image.

    Hope this helps.

    cheers,
    doug. 

  • Mridul Thomas 8 posts 28 karma points
    Oct 18, 2012 @ 13:01
    Mridul Thomas
    0

    Thanks a lot. It worked.

    Can you also please tell me how to enable cache for the images? Now it takes almost 2 sec for each image to get loaded. So the loading time for a page is very high.

     

     

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 18, 2012 @ 13:09
    Douglas Robar
    0

    Server-side caching is always enabled so ImageGen won't have to make the same image twice, saving server resources. With ImageGen Professional you can also enable client-side caching on a per-class basis with the <CachingTimeSpan> in the imagegen.config file. All explained in detail the ImageGen Reference Manual pdf if you need more info.

    cheers,
    doug. 

Please Sign in or register to post replies

Write your reply to:

Draft