Forked from samukasmk/smk_magento_resizer.php
Last active
December 23, 2015 14:59
Revisions
-
hprange revised this gist
Sep 21, 2013 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -55,9 +55,12 @@ // main image of homepage/catalog echo Mage::helper('catalog/image')->init($products, 'small_image')->resize(312); echo "<br>"; // main large size image of product page echo Mage::helper('catalog/image')->init($products, 'image')->resize(1000,1000); echo "<br>"; // main small size image of product page echo Mage::helper('catalog/image')->init($products, 'image')->resize(470,470); echo "<br>"; // thumbnails images of product page echo Mage::helper('catalog/image')->init($products, 'thumbnail')->resize(140,140); echo "<br>"; -
hprange revised this gist
Sep 21, 2013 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,16 +26,16 @@ For execute in command line: -> Put this script in your magento root path: EG: $ cd /var/www/html/my_magento_folder $ curl -O smk_magento_resizer.php -> Running resize images creation $ curl -L http://my-magento.com/smk_magento_resizer.php -> If you prefer, set this call in cron $ crontab -e ---- 5 * * * * curl -L http://my-magento.com/smk_magento_resizer.php */ ini_set('display_errors','on'); -
hprange revised this gist
Sep 21, 2013 . 1 changed file with 1 addition and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -66,16 +66,7 @@ echo "<br>"; // thumbnails images of product cart echo Mage::helper('catalog/image')->init($products, 'thumbnail')->resize(75); echo "<br>"; } ?> -
samukasmk revised this gist
Aug 29, 2013 . 1 changed file with 10 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ <?php /* smk_magento_resizer.php Resizes Images for isolated/specific magento (admin) server @@ -48,7 +48,7 @@ foreach ($collection as $product) { $products = Mage::getModel('catalog/product')->load($product->getId()); echo "---"; echo "<br>"; /* resize functions is used to resize image */ @@ -60,8 +60,14 @@ echo "<br>"; // thumbnails images of product page echo Mage::helper('catalog/image')->init($products, 'thumbnail')->resize(140,140); echo "<br>"; // image of product in cart echo Mage::helper('catalog/image')->init($products, 'small_image')->resize(88,77); echo "<br>"; // thumbnails images of product cart echo Mage::helper('catalog/image')->init($products, 'thumbnail')->resize(75); echo "<br>"; // echo "<pre>"; //print_r($products); // echo $products->getImage(); -
samukasmk revised this gist
Aug 28, 2013 . 1 changed file with 19 additions and 19 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -47,29 +47,29 @@ foreach ($collection as $product) { $products = Mage::getModel('catalog/product')->load($product->getId()); echo "---"; echo "<br>"; /* resize functions is used to resize image */ // main image of homepage/catalog echo Mage::helper('catalog/image')->init($products, 'small_image')->resize(312); echo "<br>"; // main image of product page echo Mage::helper('catalog/image')->init($products, 'image')->resize(1000,1000); echo "<br>"; // thumbnails images of product page echo Mage::helper('catalog/image')->init($products, 'thumbnail')->resize(140,140); echo "<br>"; // echo "<pre>"; //print_r($products); // echo $products->getImage(); // echo "<br>"; // echo $products->getSmallImage(); // echo "<br>"; // echo $products->getThumbnail(); // echo "<br>"; } ?> -
samukasmk created this gist
Aug 28, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,75 @@ <?php /* smk_magento_resizer.php Resizes Images for isolated/specific magento (admin) server Created By: Samuel Maciel Sampaio ([email protected]) [20130828] References where I got the core: http://stackoverflow.com/questions/2474117/how-to-get-a-products-image-in-magento http://stackoverflow.com/questions/10426210/how-to-get-product-image-in-magento Special Thanks for stackoverflow users: Suman-PHP4U (http://stackoverflow.com/users/795510/suman-php4u) silvo (http://stackoverflow.com/users/295614/silvo) Ricardo Martins (http://stackoverflow.com/users/529403/ricardo-martins) Mitch Thompson (http://stackoverflow.com/users/1399382/mitch-thompson) gowri (http://stackoverflow.com/users/430112/gowri) alex (http://stackoverflow.com/users/297028/alex) daveshaw (http://stackoverflow.com/users/383710/daveshaw) Suma Gowda (http://stackoverflow.com/users/1284719/suma-gowda) Vikrant 33 (http://stackoverflow.com/users/1379084/vikrant-33) Andriy M (http://stackoverflow.com/users/297408/andriy-m) Shiv Kumar (http://stackoverflow.com/users/1226172/shiv-kumar) For execute in command line: -> Put this script in your magento root path: EG: # cd /var/www/html/my_magento_folder curl -O smk_magento_resizer.php -> Running resize images creation # curl -L http://my-magento.com/smk_magento_resizer.php -> If you prefer, set this call in cron # crontab -e ---- # 5 * * * * curl -L http://my-magento.com/smk_magento_resizer.php */ ini_set('display_errors','on'); require_once 'app/Mage.php'; Mage::app('default'); $collection = Mage::getModel('catalog/product')->getCollection(); foreach ($collection as $product) { $products = Mage::getModel('catalog/product')->load($product->getId()); echo "---"; echo "<br>"; /* resize functions is used to resize image */ // main image of homepage/catalog echo Mage::helper('catalog/image')->init($products, 'small_image')->resize(312); echo "<br>"; // main image of product page echo Mage::helper('catalog/image')->init($products, 'image')->resize(1000,1000); echo "<br>"; // thumbnails images of product page echo Mage::helper('catalog/image')->init($products, 'thumbnail')->resize(140,140); echo "<br>"; // echo "<pre>"; //print_r($products); // echo $products->getImage(); // echo "<br>"; // echo $products->getSmallImage(); // echo "<br>"; // echo $products->getThumbnail(); // echo "<br>"; } ?>