Announcement

Collapse
No announcement yet.

Image Machine on OUSM page?

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

  • Image Machine on OUSM page?

    A client asked me to do some work on the OUSM page, and we'd like to get the Image Machine working here, so that the store can automatically create thumbnail images. I found some other posts about this, but all were a few years old. At that time, the consensus was, in effect, "don't try it; use Toolkit." Has anything changed since then?

    From looking at other page setups, I get the impression that a lot of the Image Machine functionality is actually built into other components, like Product List and Basket Contents. OUSM doesn't use any of those, so just assigning Image Machine components to the page won't work.

    Anyone have any advice on this?

    Thanks --
    Kent Multer
    Magic Metal Productions
    http://TheMagicM.com
    * Web developer/designer
    * E-commerce and Miva
    * Author, The Official Miva Web Scripting Book -- available on-line:
    http://www.amazon.com/exec/obidos/IS...icmetalproducA

  • I also found it won't work and nothing has changed as far as I know. The API has functions to accomplish whatever you might need. You won't need Toolkit. I'm not sure TK had the functions anyway. I don't know this either, but my estimated guess is Ray may have built some of the functions you might need in ToolBelt (now available freely).

    As a reminder or for those that are being introduced to this; Here's a sample snippet of code I've used to manipulate images in place of the Imagemachine from the API:

    Code:
       <mvt:do name="l.success" file="g.Module_Library_DB" value="ProductImage_Load_Type(l.settings:product:id, 1, l.settings:imagetype)" />
       <mvt:do name="l.success" file="g.Module_Library_DB" value="Image_Load_ID(l.settings:imagetype:image_id, l.settings:imagedata)" />
       <mvt:assign name="g.productImage" value="g.baseurl $ l.settings:imagedata:image" /> 
       <mvt:do name="l.image_loaded" file="g.Module_Library_DB" value="Image_Load_File( g.productImage, l.image )" />  
       <mvt:comment> Then to resize image...</mvt:comment>
       <mvt:do file="g.Module_Library_DB" name="l.generated_image_loaded" value="GeneratedImage_FindOrInsert_Image_Dimensions( l.image, '120', '120', l.settings:generated_image )" />
    Scott
    What help do you need today!
    Interactive Design Solutions http://www.southbound.com
    MivaMerchant Business Partner | Certified MivaMerchant Web Developer
    My T-shirt Collection is mostly MivaCon T-shirts!!
    Competitive Rates, Popular Modules, and Integrations:
    Product Copy | AutoBaskets | Waitlist Integration| Wholesale Integration

    Comment


    • Toolkit can pull in an image but it has to already be resized. It can't resize on the fly.
      Leslie Kirk
      Miva Certified Developer
      Miva Merchant Specialist since 1997
      Previously of Webs Your Way
      (aka Leslie Nord leslienord)

      Email me: [email protected]
      www.lesliekirk.com

      Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

      Comment


      • Thanks for the code, Scott, that's a big help. Just to complete the process: I gather that, after executing that code, the path to the new image file will be in l.settings:generatedimage:image. Is that correct?

        Also, I noticed that you put quotes around the image height and width, making them strings instead of numbers. Is that necessary?
        Kent Multer
        Magic Metal Productions
        http://TheMagicM.com
        * Web developer/designer
        * E-commerce and Miva
        * Author, The Official Miva Web Scripting Book -- available on-line:
        http://www.amazon.com/exec/obidos/IS...icmetalproducA

        Comment


        • Originally posted by Kent Multer View Post
          Thanks for the code, Scott, that's a big help. Just to complete the process: I gather that, after executing that code, the path to the new image file will be in l.settings:generatedimage:image. Is that correct?

          Also, I noticed that you put quotes around the image height and width, making them strings instead of numbers. Is that necessary?
          It's been a while since I vetted this code. For both questions, double-check the functions in the API. Yes, I recall that that member of the branch is the path and graphic filename. Equiv to the src attribute in an image tag. And I think the quote surround the height and width is necessary but, I'm not 100% positive.

          Scott


          What help do you need today!
          Interactive Design Solutions http://www.southbound.com
          MivaMerchant Business Partner | Certified MivaMerchant Web Developer
          My T-shirt Collection is mostly MivaCon T-shirts!!
          Competitive Rates, Popular Modules, and Integrations:
          Product Copy | AutoBaskets | Waitlist Integration| Wholesale Integration

          Comment

          Working...
          X

          This website uses cookies to identify visitors, track visitors to our website, store login session information and to remember your user preferences. By continuing to use this site you agree to our use of cookies. Learn More.

          This website uses cookies. By continuing to use this site you agree to our use of cookies. Learn More.

          Accept