Changing Small Image For All Products in Magento - sql

I use the sql code below, and it seems to work fine, and when I check the admin panel of magento, I see that the change is done as in the picture. However, when I check the website, I see the position 1 product still in all products as small image. Nothing seems to be changed in front end. I cleared all the caches but still the same, any ideas?
UPDATE duvargiydir_catalog_product_entity_media_gallery AS mg,
duvargiydir_catalog_product_entity_media_gallery_value AS mgv,
duvargiydir_catalog_product_entity_varchar AS ev
SET ev.value = mg.value
WHERE mg.value_id = mgv.value_id
AND mg.entity_id = ev.entity_id
AND ev.attribute_id IN (86)
AND mgv.position = 2;

You may need to flush the image cache located at System -> Cache Management.
You'll see a button on the bottom that says "Flush Catalog Images Cache" or something similar.
Magento will create a resized and compressed image to display on the front-end rather than the original. So if you change the original in the database the observer methods were not triggered to clear the cache and recreate the thumbs.
Doing this will allow for the thumbs to regenerate on page load.

Related

Force Image control to re-download the image

I have an Image control on Page1.xaml that is pointing at a URL: http://www.example.com/blah.jpg
I navigate to Page2.xaml and upload a new image to that url using my WebAPI. I call Frame.GoBack() to navigate back to Page1.xaml.
The old image is still displayed in the Image control. How can I make sure that Image control re-downloads the image even though its at the same URL?
The only way I found was to append a query string to the end of the image. It's a bit of a hack and it can interfere with Save operations but it is effective.
Just to be clear, I set the property with the image url with a value like this:
"http://www.example.com/blah.jpg?id=" + Guid.NewGuid()
That triggers the RaisePropertyChanged event and the Image control is tricked into thinking the image changed.
Set the BitmapImage.CreateOptions property to IgnoreImageCache.
From MSDN:
The other possible value for CreateOptions is
BitmapCreateOptions.IgnoreImageCache. You should only use
BitmapCreateOptions.IgnoreImageCache in cases where you know that the
source image file as retrieved by URI has the potential to change over
time. Otherwise, setting CreateOptions to use
BitmapCreateOptions.IgnoreImageCache causes all newly retrieved image
sources to be decoded again, which can negatively impact performance.
...

Databinding uri source of imagebrush

In my application i am binding several properties to a custom user control, and everything works fine, except the images are not showing. For binding i have used the following codes:
Categories.Add(new Models.Category { Name = "Pizza", Count= 4, ImageUri = new Uri("Images/pizza.png", UriKind.Relative) });
I have also tried with different urikinds but the images are never showing.
what could go wrong? The images are in my solutions Images folder.
Use the ms-appx URI scheme:
ImageUri = new Uri("ms-appx:///Images/pizza.png");
Take care to really write ///.
Also make sure that the Build Action of the image file is set to Content, as pointed out in the other answer. Setting Copy to Output Directory does however not seem to be necessary.
Be sure you set the properties of the image so that it is available during runtime. Sometimes if employing Design Time data in Blend, you will see the images in Design Time, but then nothing during run time. The reason is that the images were never deployed with the rest of the solution. Be sure the Build Action on each image is set to Content and I usually set the Copy to Output Directory to Copy if Newer.

Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported

I have a canvas that was created by a user (me) dragging an image onto a dropzone. As part of saving the image, I call toDataURL.
var theCanvas = document.getElementById ("idCardCanvas");
var urlImage = theCanvas.toDataURL ();
This code has worked for months when it was running from one domain, littlecardeditor.com.
I am now in the process of adding this functionality to Radio3, at http://radio3.io/.
Both domains are Amazon S3 buckets, both have the same CORS configuration (clutching at straws here, I don't see why CORS enters into it, since the images come off my hard disk, not from any domain).
I dragged the images from the Desktop, based on advice from another thread here.
None of it makes a difference. It works when I use it on littlecardeditor.com and fails with the "tainted canvas" error when called on radio3.io.
Not sure what else to look at. Any clues would be much appreciated! :-)

Partial view never affects site after upload and IIS reset

I'm including a partial view in one of the pages of my MVC4 site which when deployed, even after a restart of the web site and recycling of the app pool, never seems to affect the site
I'm wondering if this is caching coming into play
I ended up including the content of the partial view in the page iteself and that seems to have worked but I'd rather have the partial view as I'd like to use the view in other parts of the site
The question is, does anyone have any suggestions as to why this might be happening? I've been pulling my hair out trying to get a view to post the correct data, only to realise that some of the hidden inputs are just missing because the partial view has not been refreshed
EDIT:
Ok now I have a need to use this partial view in more than once place. On my dev environment the partial is rendering correctly. Uploading to the server doesn't seem to have any effect, but what's worse, deleting the partial view from the server also has the same issue.
My site still thinks the file is there and complains about the model type passed to the view now (I changed the model type in the view - all working fine on my local dev) - why does it still think the file is there?
I deleted one of the parent views to see if the site carried on working, but as soon as I delete any other file, the site is affected. Why is this particular file giving me trouble? It's as if the server has cached it at the file system level and is supplying the wrong file content to ASP.NET
I'm going to try renaming the file next
Ok so renaming the file appears to have worked.
I didn't try Fals suggestion but I might try that next time, strange behaviour I'm not going to try and understand why at this point!

IKImageBrowserView Thumbnail Problem

I download IKImageBrowserView sample named "IKImageKit Demo" from Apple official website.
But I find a problem.
For example:
When I import images from folder named "A", then I delete an image.
Then I import other image (name as same as the deleted image), the thumbnail in
IKImageBrowser will not change.
How could I resolve this problem?? Thanks!
Video display: http://www.youtube.com/watch?v=f3Jue9wOdUI
I came across a reference that said the internal cache IKImageBrowserView uses looks up thumbnails by ImageUID. So if you change the ImageUID that your data source returns to be something other than just file name (maybe file name + file size), then it will be treated as a different image.
You should take a look at the IKImageBrowserItem Protocol's imageVersion method. If you need to let IKImageBrowserView know that a item has changed its image you can increment the imageVersion. This will force the view to update the cached image.
Update: Wow, old post. Looks like the documentation was updated a while after I had posted; as the other answers suggest, looks like you need to increment the image's imageVersion to update an image from cache.
After mulling over the problem for close to three hours (once I started, it was really bugging me, too!), I came to the sad conclusion that it's a bug in how IKImageKit handles images. IKImageBrowserView has a cache of images and thumbnails, and from whatever experimental data I have, I'm guessing that it just caches its images based on location on disk, and not on image data (so it can load the data lazily, I guess), so even if the actual image data can change, reloading the same file location will not update the image itself.
Of course, I could be completely wrong - which wouldn't surprise me, since there's literally no documentation on the issue, so I have nothing but results from Instruments and the app itself to guide me - but my advice to you is to ignore the issue for now, since there's nothing you can do about it, and possibly file the bug with Apple.
Of course, if anyone can introduce other evidence about this, please do! I'd love to know more about it.
Good luck!
you should want to imageVersion update or name the image of the path.
if you delete image with name "1.png" after you put image if it's name "1.png" the image browser view show the previous image so you should take care of image naming. or imageVersion method.