SourceTree Issue: This is not a Valid Working Copy Path

Introduction

We will discuss a quick tip to resolve the SourceTree issue mentioned in the title.

Background

My system got upgraded to Windows 8.1 and I had to install all required software for the development work. I use SourceTree as a tool for Git commands for the projects. So, I installed that again after the format.

Problem

Unfortunately, when I started adding the projects as working copy, it complained me that “This is not a valid working copy path“. The error is not so much self explanatory, which triggered research work.

Solution

Before I landed upon the solution, I had visited all available menu options in SourceTree to find out the problem. Finally, something engrossed me. I was on Git Tab.

Tools -> Options -> Git

I found some buttons saying “Use Embedded Git“, “Use System Git” at the bottom. So, I suspected that Git is not yet enabled for SourceTree. Therefore, it is not able to identify my commands. I enabled it, that’s why it is shown as disabled below.

SourceTree Git Settings

SourceTree Git Settings

Voila!!! Everything started working as expected.

Help Someone

Share in your circle. Hit the social icons below. Keep coding folks. 🙂

Thanks for reading, have a great day ahead.

Advertisements
Visual Studio Error

Unable to Start Debugging on the Web Server. The Web Server is not Configured correctly.

Visual Studio Error

Visual Studio Build Error

Introduction

This blog is regarding one issue which happened couple of days back while building a demo app.

Background

One of the freshers in my company had this issue and I tried to resolve. The opportunity is huge, when you try to put yourself in their boot. They do crazy things and break the application. However, as my tech name is “BugTrapper“, so I started my research.

Problem

Then I found that the application is hosted in IIS with an IP in the binding.

iis-binding

Binding in IIS

Now, I wanted to check the Project Url in the Project Properties. This is what I saw.

project-properties

Project Properties

So, it’s obvious now. The problem is the URL mismatch.

Solution

I just updated the Project Url to the IP mentioned in IIS. Voila!!! All started working at the next moment.

Have you ever Faced This?

If yes, please comment below. Let’s discuss. Like and share if you want to save someone’s time. 🙂

Uncaught IndexSizeError: Failed to execute ‘getImageData’ on ‘CanvasRenderingContext2D’: The source width is 0.

Introduction

In this post, we will discuss a problem, which I recently came across while working with images in coding.

Background

The work was to take one image from the file upload control and then compress it using canvas before uploading it to the server. I used a plugin, but let’s not go into that. We will directly come to the point where this problem can happen.

Problem

So, the line that we are talking about is like below.

var canvas = canvas.getContext('2d')
                   .getImageData(0, 0, imgWidth, imgHeight);

We are sending image width and height to getImageData. However, if you analyze the error message, it says that width is 0.

Solution

With further research on developer console while debugging, I found that the width and height are actually populated in some other properties named as naturalWidth and naturalHeight.
Therefore, we can write the code like below.

var imgWidth = image.width || image.naturalWidth;
var imgHeight = image.height || image.naturalHeight;

var canvas = canvas.getContext('2d')
                   .getImageData(0, 0, imgWidth, imgHeight);

Now your program should work as expected without errors.

More on naturalHeight and naturalWidth from MDN

HTMLImageElement.naturalHeight (Read only)
Returns a unsigned long representing the intrinsic height of the image in CSS pixels, if it is available; else, it shows 0.
HTMLImageElement.naturalWidth (Read only)
Returns a unsigned long representing the intrinsic width of the image in CSS pixels, if it is available; otherwise, it will show 0.

Feedback

If you like this blog, feel free to share it in your circle and save someone’s time. Please comment below, if you have any inputs for me.

Thanks for reading. Have a nice day ahead.

SourceTree Issue: The Mercurial team strongly encourages all users to upgrade to 3.7.3 due to security vulnerability

Introduction

If you see the above issue when you update the SourceTree, then follow the steps mentioned below to resolve it. Those who don’t know, it is a free Git and Mercurial client for Windows or Mac, which makes source code management easier with a GUI.

Background

I appreciate how the SourceTree team is continuously improving the software and making it more user friendly. But today, when I updated it to the latest version and opened it again, I saw a weird issue popped up, instead of the SourceTree window.

SourceTree Error

The issue is…

The Mercurial team strongly encourages all users to upgrade to 3.7.3 due to security vulnerability

What is Mercurial?

Mercurial is a free, distributed source control management tool. It efficiently handles projects of any size and offers an easy and intuitive interface.

Problem

The version of the Mercurial on your system is old and it has some security vulnerability, which they have fixed and updated with the latest version. If we dig more into the upgrade notes, the below is what you will find.

Mercurial Security Vulnerability Fixes

Solution

Go to Mercurial Download Page. Download the latest package according to your system configuration. Now, SourceTree should work as expected.

Mercurial Downloads