Tag Archive for 'Solutions'

Making Smarter Thumbnails

I was recently tasked to improve the look and functionality of a site that lets users upload images. One of the area I looked into was how it handled automatic thumbnail generation, because I found the thumbnails that were being generated to be, well, plain ugly.

The method they used was a standard resize to max width and height. The uploaded photo is scaled down proportionately to fit into a box of specified width and height. This resulted in irregularly sized thumbnails and even more so when users upload photos with strange dimensions. Not only does it make the page look messy and disorganized, Continue reading ‘Making Smarter Thumbnails’

Getting video length in AS3

To get the length of a loaded FLV, you need to have an object listening to the meta data stream. Here’s how:

var vidClient:Object = new Object();
vidClient.onMetaData = onMetaData;
ns.client = vidClient; //ns is the netstream object

function onMetaData(metadata:Object):void {
lengthOfVideo = int(metadata.duration * 1000)+1;
trace("Length of flv from metadata = " + lengthOfVideo);

 

vidClient.onMetaData = null;
vidClient = null;
}

If you’re wondering how to actually load and play the flv file:

var nc : NetConnection;
var ns : NetStream;
var vid : Video;
var path : String = "test.flv";

nc = new NetConnection();
nc.connect(null);
ns = new NetStream(nc);
addChild(vid);

//optional events to handle status and error
ns.addEventListener(NetStatusEvent.NET_STATUS, statusHandler);
ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);

vid.attachNetStream(ns);
ns.play(path);

Photoshop’s Save As dialog box appears and disappears

More like a flicker I should say, and then Photoshop seems to have hung. Well apparently the window is still there, its just off screen. Press ‘esc’ to close it and try File->save again. If it still doesn’t show up, use the following combination:

Alt key, Space bar, ‘M’

and use the arrow keys to guide the lost dialog back to your screen. If pressing left doesn’t work, try pressing right. Have fun.

 

For more details:
http://kb.adobe.com/selfservice/viewContent.do?externalId=kb403268

ZBrush to Maya and back again

It is common to want to bring your model out of zbrush to do up the uv’s (although it is always a better idea to deal with them BEFORE getting into zbrush), but importing the edited .obj back into zbrush can be a hassle, esp when your model ‘explodes’ inexplicably when you move up the subdiv level.

Example of a exploded model:

Exploded model

Exploded model

To save a few souls, below is what worked for me and you can try to take note of the following when nothing seems to work:
(Tested with ZBrush 3.1 and Maya 2008)

In ZBrush

When exporting from zbrush, make sure you are at the lowest subdiv level.

Under Tool->Texture, make sure you have UV enabled:

Enable UV

Enable UV

Under Tool->Export, turn off the ‘Grp’ option and on the ‘Mrg’ option as such:

Export from ZBrush

Export from ZBrush

In Maya

Go to File->Import Options, and set the settings as below:

(Note: When editing DO NOT move the vertices in maya, only edit the UV’s)

When exporting, go to File->Export Selection Options. Select OBJ and off all the File Type Specific Options in the last section:

Back in ZBrush

Import the .obj while still at subdiv level 1.

After import, move up a level to check if it explodes.

Feel free to leave any comments whether this worked for you and also for others to benefit from your experience =)

IIS Service failing, cannot start Com+ System Application

Recently my IIS service have been failing with COM+ errors in my event log:

A condition has occurred that indicates this COM+ application is
in an unstable state or is not functioning correctly.
Assertion Failure: SUCCEEDED(hr)

Server Application ID: {02D4B3F1-FD88-11D1-960D-00805FC79235}
Server Application Instance ID:
{A62B5BD2-D95E-4CA0-AD12-E719088125BC}
Server Application Name: System Application
The serious nature of this error has caused the process to terminate.
Error Code = 0x8000ffff : Catastrophic failure
COM+ Services Internals Information:
File: d:qxp_slpcomcom1xsrccomsvcstrackertrksvrtrksvrimpl.cpp, Line: 3000
Comsvcs.dll file version: ENU 2001.12.4414.308 shp

Microsoft’s Malicious Software Removal Tool reports that it removed CutWail from my system but on furthur inspection CutWail was still present and I manually removed the 2 files (ip6fw.sys and secdrv.sys) in %systemroot%/system32/drivers/ along with some reg entries.

Next I suspected a corrupted IIS installation, so I reinstalled IIS but the problem persists. It turns out the COM+ System Application Service could not be start. (And IIS depends on COM+)

The symptons are as follows (i’ve ranked them in order of discovery):

  1. Visual Studio refused to load web application projects. (giving me the “visual studio cannot create or open the application because the web server on this computer is not running” error)
  2. Browser unable to connect to localhost
  3. World Wide Web Publishing service stops by itself after it starts. (Or when i try to load projects in VS)
  4. IIS Admin service stops in the same fashion as the above.
  5. COM+ errors in event log (see event details above)
  6. COM+ System Application could not be start (Error when you try to start it).

After looking around and tested many solutions I finally found one that fixed the problem (without reformating and reinstalling everything, as a few people suggested).

Solution:

  1. Refer to How to clean up a damaged COM+ catalog (http://support.microsoft.com/default.aspx?scid=kb;en-us;315296) to repair COM+
  2. Reinitialising IIS by running rundll32 %windir%system32inetsrvwamreg.dll, CreateIISPackage (also detailed in the KB article)

Did the above work for you too?