Announcement

Collapse
No announcement yet.

PHP resizing images

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    PHP resizing images

    I have an external PHP file that runs an image resizing script. The script works perfectly well outside of actinic but as soon as I try to incorperate it within Actinic it doesnt seem to execute.

    The original line within the wqorking test html is -

    Code:
    <img src="thumb.php?src=/image/1151.jpg&w=103&h=200&zc=0" alt="" />
    Putting it into actinic I have changed it to -

    Code:
    <img src="thumb.php?src=<actinic:variable name="ProductImageFileName" />&w=103&h=200&zc=0" alt="<actinic:variable name="ProductName" />" />
    Then when uploaded it produces -

    Code:
    <img src="thumb.php?src=images\products\1850.jpg&w=103&h=200&zc=0" alt="B-Gluco Balance x 90 Caps" />
    Which is right other than the slashes being the wrong way, it hasnt been converted into a web path.

    Anybody know what the problem is.

    I have had a look at the image resizing method in KB but he results arent as sharp and it produces extra files.

    #2
    Try replacing:

    <actinic:variable name="ProductImageFileName" />

    with
    Code:
    <actinic:block php="true">echo basename('<actinic:variable name="ProductImageFileName" encoding="perl" selectable="false" />');</actinic:block>
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Thanks it works!

      I just have one small issue. The index.htm/Home Page file sits on its own outside the catalog folder. When the script is ran on the index file the paths are wrong.

      Is there anything i can do. The only thing i can think of is to duplicate all of the images so that they are on the same level as the index.htm. But this obviously defeats the point of having a resize script that doesnt duplicate the file.

      Comment


        #4
        Add a blockif to the above code testing IsBrochureHomePage and add in the relative path on just that page.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment

        Working...
        X