1
votes

I use Magento Enterprise ver. 1.13.1.0, I have a custom extension to upload images, this images are use for the customer avatar, the issue is after I press save button this images are not uploaded in the media folder. In the firebug I have this errors:

recs f.2 - fix responsive

Loading LPS_LSH version 1.8.8 (Toolbox v2.3) with debug mode - Revision: 1.3

no subscriber data found in storage

recs 1.1

"NetworkError: 404 Not Found - https://www.domain.com/media/pix_resized/customer/l/o/70x70logo653926.png"

The images is get like this:

 <img class="small-image-preview v-middle" width="70" height="70" src="<?php echo Mage::helper('pixcore/image')->resizeImg($this->helper('pixseller')->getStorePhotoUrl(true), 70, 70, 'customer') ?>" title="View Full Size" alt="View Full Size">
2

2 Answers

1
votes

Now as i can see either your image is not uploading or creating thumbs has problem. Please follow the below code how i make thumbs. then use it with img source.

$mediaurl= Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
                                    $imageResized = Mage::getBaseDir('media')."/latestnews/resized_".$news->getData('thumbnail');


                                    $imageObj = new Varien_Image(Mage::getBaseDir('media').'/'.$news->getData('thumbnail'));
                                    $imageObj->constrainOnly(TRUE);
                                    $imageObj->keepAspectRatio(FALSE);
                                    $imageObj->keepFrame(FALSE);
                                    $imageObj->resize(177,138);
                                    $imageObj->save($imageResized);
<img src="<?php echo $mediaurl.'latestnews/resized_'.$news->getData('thumbnail');?>" class="post-image img-responsive" title="<?php echo $news->getData("content_heading")?>" alt=""/>
0
votes

Please use media url then path . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); Thanks.