Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

ruby on rails - How do I resize high-res photos to thumbnails? -


i have site user can upload photo. have no idea how handle photos. make thumbnail out of large res photo, resize width , height? or there better way this?

if point me resources or give me tips, great.

i'm using ruby on rails, if matters. don't want gems because want learn how myself.

for of this, "learning how yourself" going significant undertaking. resizing image, example. go ahead , find open source library (such gem) resizes images , through source code. it's not impossible on own, lot of sort of thing built on expertise that's come before, etc. there's nothing wrong making use of tool else has created, provided understand tool doing.

a few points out:

  1. go white-list approach of image formats support. don't let users upload call image.
  2. each format support going have own standards (possibly multiple) meta-data. stripping out data wholesale may or may not idea. example, jpeg may contain orientation in exif data , if strip out may rotating image. fields, such geotagging, may want strip out in effort protect users' privacy, etc. again, existing libraries , see how it.
  3. do not implicitly trust file name extension determining type of image. it's possible user construct malicious file isn't image, pass off image unsuspecting host, , open security flaw on host tries process file image. there question determining file type in ruby here, , i'm sure there's lot more found on subject.

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -