Example #1
0
func newServerImage(srv imageserver.Server) imageserver.Server {
	var hdr imageserver.Handler
	hdr = &imageserver_image.Handler{
		Processor: imageserver_image_gamma.NewCorrectionProcessor(
			&imageserver_image_gift.Processor{
				DefaultResampling: gift.LanczosResampling,
				MaxWidth:          2048,
				MaxHeight:         2048,
			},
			true,
		),
	}
	hdr = &imageserver_image_gif.FallbackHandler{
		Handler: &imageserver_image_gif.Handler{
			Processor: &imageserver_image_gif.SimpleProcessor{
				Processor: &imageserver_image_gift.Processor{
					DefaultResampling: gift.NearestNeighborResampling,
					MaxWidth:          1024,
					MaxHeight:         1024,
				},
			},
		},
		Fallback: hdr,
	}
	return &imageserver.HandlerServer{
		Server:  srv,
		Handler: hdr,
	}
}
Example #2
0
func newServerImage(srv imageserver.Server) imageserver.Server {
	return &imageserver_image.Server{
		Server: srv,
		Processor: imageserver_image_gamma.NewCorrectionProcessor(
			&imageserver_image_nfntresize.Processor{},
			true,
		),
	}
}
Example #3
0
func newServerImage(srv imageserver.Server) imageserver.Server {
	return &imageserver_image.Server{
		Server: srv,
		Processor: imageserver_image_gamma.NewCorrectionProcessor(
			&imageserver_image_gift.Processor{
				DefaultResampling: gift.LanczosResampling,
				MaxWidth:          2048,
				MaxHeight:         2048,
			},
			true,
		),
	}
}
Example #4
0
func newServerImage(srv imageserver.Server) imageserver.Server {
	basicHdr := &imageserver_image.Handler{
		Processor: imageserver_image_gamma.NewCorrectionProcessor(
			imageserver_image.ListProcessor([]imageserver_image.Processor{
				&imageserver_image_crop.Processor{},
				&imageserver_image_gift.RotateProcessor{
					DefaultInterpolation: gift.CubicInterpolation,
				},
				&imageserver_image_gift.ResizeProcessor{
					DefaultResampling: gift.LanczosResampling,
					MaxWidth:          2048,
					MaxHeight:         2048,
				},
			}),
			true,
		),
	}
	gifHdr := &imageserver_image_gif.FallbackHandler{
		Handler: &imageserver_image_gif.Handler{
			Processor: &imageserver_image_gif.SimpleProcessor{
				Processor: imageserver_image.ListProcessor([]imageserver_image.Processor{
					&imageserver_image_crop.Processor{},
					&imageserver_image_gift.RotateProcessor{
						DefaultInterpolation: gift.NearestNeighborInterpolation,
					},
					&imageserver_image_gift.ResizeProcessor{
						DefaultResampling: gift.NearestNeighborResampling,
						MaxWidth:          1024,
						MaxHeight:         1024,
					},
				}),
			},
		},
		Fallback: basicHdr,
	}
	return &imageserver.HandlerServer{
		Server:  srv,
		Handler: gifHdr,
	}
}