Get a bit of code after image url in browser - vue.js

I'm changing background image on hover.
The code for image url looks like this:
background-image: url('../assets/img/project1.png');
But when I look in the Chrome inspector it looks like this:
background-image: url(/img/project1.9fba20d0.png);
So when I try to change image need that code (9fba20d0) for it to work.
Why dose '9fba20d0' appear? How do I remove it or get it without hardcoding it?

I actually haven't used Vue.js, but I'm sure the random string appended to end of filename is for "cache busting" purposes.
Basically, the string changes each time you build your application so the next time you request index.html from the server it will reference the new filename (with a different random string at the end). If there was no string, the browser would look locally to find the file, which may be an outdated version, if you've made changes since last rebuild.
I'd try and understand how Vue.js is creating your production "assets", i.e. all the images and other static files and see if you have some options to change the default behavior, if need be. Might have to read the documentation pertaining to caching.
Hope that at least points you in the right direction!

Related

iTextSharp.text.Image.GetInstance changes Request.MapPath

I've been stuck on this problem all night. I've looked everywhere and can't seem to find anything related to my exact problem. On our IIS server we have a page that creates a pdf. We put an image in the header of the created PDF. This had been working properly until last night when we updated some unrelated code on different pages. Now when we try to create the PDF we get an error that the image file doesn't exist. Here's the weird part, iTextSharp.text.Image.GetInstance is changing the path we send to it?
Here's the line of code
Dim oImage As iTextSharp.text.Image = iTextSharp.text.Image.GetInstance(Request.MapPath("~/images/" & sLogo))
If we output the results of Request.MapPath("~/images/" & sLogo) we receive
E:\Inetpub\sitename\images\logo.jpg
When we place it in in the iTextShart.text.Image.GetInstance() function our path output changes to
C:\Windows\SysWOW64\inetsrv\images\defaultlogo.jpg
You can see the logo itself changes too, it should be noted that we do use DefaultLogo.jpg in the case that a client doesn't use their own logo but all the ones i'm testing with do. The path E:\Inetpub\sitename\images does exist and logo.jpg does exist.
Here's the weirdest part, if i change the path from images to image
IE: iTextSharp.text.Image.GetInstance(Request.MapPath("~/image/" & sLogo))
the output will be
E:\Inetpub\sitename\image\logo.jpg
So i have no idea why images doesn't resolve.
Any help is greatly appreciated, and if this answer has been posted before and i just can't find it i'm very sorry, and if you could point me to that i would appreciate that as well.
I figured out my issue, and it's sheer stupidity on my part. The page we call to create the pdf had bad security on it. Basically we were looking for a session variable that didn't exist and redirected that page to a session time out notice. Removed that session check and it's working now!

Overwrite IpReflection

I want to change Avatar, but I want to use ipReflection() too.
when I upload first image it works but when I change it stays the same, I tried to unbind then bind again same image but it doesn't work.
ipUnbindFile($image, 'UserModuleLogo', ipUser()->userId(), 'file/repository/UserFiles/');
ipBindFile($image, 'UserModuleLogo', ipUser()->userId(), 'file/repository/UserFiles/');
Binding the file is inserting its data to a database. There could be two issues, why changes aren't visible instantly:
Browser cache. You save a new file with the same file name and browser thinks nothing has changed.
Reflection cache. If filename is the same and options are the same, ImpressPages pulls image from the reflections without touching a new file.
To fix the first issue, always change filename or add random parameter and the end of the file, i.e. "image.jpg?1029231230".
To fix the second issue, always delete all reflection before replacing the file.

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.
...

Middleman Build assets without hash

How do I configure Middleman to build images without appending a hash to the filename? I'm referring to filepaths in javascript and need to know the full filename to refer to the files. My JS doesn't get updated with the hashed filenames like my CSS does.
Oops, figured it out. I had enabled activate :asset_hash. removing that from config.rb fixed it.
No need to abandon :asset_hash just because you want to refer to them in JS. The asset hash extension actually attempts to rewrite paths in CSS and JavaScript automatically, but it sounds like whatever way you're linking them isn't getting detected.
You can always name your javascript something like application.js.erb and then have code like this:
var my_image = <%= image_path("myimage.png") %>;
That way you'll always have the right path.

Relative path names VB2010

I'm trying to write a little Jukebox application in VB Forms, and I need the pathnames of the sound files (\bin\Tracks\"Insert Name Here") to be relative instead of absolute, so that it may work on a different computer to mine. At the moment, I am testing with the simple Soundplayer class, and the single line of code to play a song is this:
My.Computer.Audio.Play("\bin\Tracks\" & txtCurrentlyPlaying.Text)
It works when, instead of \bin\Tracks\, I put the full pathname (C:\Documents And Settings etc.), but not when I try a relative path such as this. Can anybody help?
Thank you for your time.
Nick
Try Path.Combine(Environment.CurrentDirectory, txtCurrentlyPlaying.Text)