Finder Won’t Show Image Dimensions

Let’s say normally you get your image dimensions by looking at the image in Finder. It should contain information about the file size as well as dimensions. However, lately Finder has been annoyingly omitting the file dimensions. This is a bug and not intentional. Here’s what my screen looks like:

 

 

 

 

 

 

 

 

 

 

 

 

You have to tell finder to re-index a bunch of shit. Just run the following (keep in mind this will take quite a while but it runs in the background so whatevs.

[pastacode lang=”bash” manual=”sudo%20mdutil%20-E%20-i%20on%20%2F” message=”” highlight=”” provider=”manual”/]

Once it re-indexes everything it should find all your images and begin adding dimensions to the info section. Be aware this could take quite a while (a couple hours) depending on your system.

NOTE: This site is all about helpful hints tricks and tips. The posts lately have been short on purpose. For one, I’m busy AF and don’t have the time to post anything of great detail. Additionally, I believe in simplicity. You can visit, find something helpful and move on with your life.

As always I appreciate your feedback, please leave a comment if you feel I’m leading people down a less than idea path or just comment because you like talking IDC.

Find the (x,y) coordinates of an index value in an array

Web graphics often require us to work with images (bitmaps) in the form of a giant array of rgb values. However translating between the index of the array and the x,y coordinates of the bitmap can be confusing. I’ve written a couple formulas below to help you translate from index to x,y and vice versa.

Let’s say you have an array of blocks that you want to draw to a canvas. Let’s also say you want to compute the (x,y) coordinates of a specific item in the array. There’s a formula for that:

[pastacode lang=”javascript” manual=”var%20blockSize%20%3D%202%3B%0Avar%20totalBlocks%20%3D%20(canvas.width%20%2F%20blockSize)%20*%20(canvas.height%20%2F%20blockSize)%3B%0Avar%20cursor%20%3D%20index%20%25%20totalBlocks%3B%0Avar%20columns%20%3D%20canvas.width%20%2F%20blockSize%3B%0Avar%20x%20%3D%20(cursor%20%25%20columns)%20*%20blockSize%3B%0Avar%20y%20%3D%20(cursor%20%2F%20columns)%20*%20blockSize%3B” message=”” highlight=”” provider=”manual”/]

All this does is count up to the index taking into account the fact you need to wrap blocks of a certain size.

If you don’t need a specific block size and are just using single pixels as a block size, then the formula is simple:

[pastacode lang=”javascript” manual=”var%20x%20%3D%20index%20%25%20columns%3B%0Avar%20y%20%3D%20index%20%2F%20columns%3B” message=”” highlight=”” provider=”manual”/]

That’s it~