public
Description: A Mac OS X photo uploader program for my photo album.
Homepage: http://bleu.west.spy.net/~dustin/projects/photoupload/
Clone URL: git://github.com/dustin/photoupload.git
dustin (author)
Mon Oct 29 22:11:24 -0700 2007
commit  63f39e4d4d6371aeb1b7afb5ef375f57cea456f5
tree    0a10805d736d82caf73478bf79514ffc794c559f
parent  3725f3fbb6f13fb33293b37303d88c1e48b95ef1
photoupload / PUImage.m
100644 54 lines (43 sloc) 0.891 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// PUImage.m
// PhotoUpload
//
// Created by Dustin Sallings on 2005/29/3.
// Copyright 2005 Dustin Sallings <dustin@spy.net>. All rights reserved.
//
 
#import "PUImage.h"
#import "SizeScaler.h"
 
@implementation PUImage
 
-(id)initWithPath:(NSString *)path
{
  id rv=[super init];
  filename=[path retain];
  
  // Load up the image
  image=[[NSImage alloc] initByReferencingFile: filename];
  [image setName: path];
  [image setScalesWhenResized: YES];
  SizeScaler *sc=[[SizeScaler alloc] initWithSize: [image size]];
  NSSize theSize={64.0, 64.0};
  [image setSize: [sc scaleTo: theSize]];
  [image recache];
  
  return(rv);
}
 
-(void)dealloc
{
  [filename release];
  [image release];
  [super dealloc];
}
 
-(NSString *)filename
{
  return(filename);
}
 
-(NSImage *)image
{
  return(image);
}
 
-(NSString *)description
{
  return([NSString stringWithFormat:@"<PUImage path:%@>", filename]);
}
 
@end