简体   繁体   English

iPhone / iPad应用程序图像格式化最佳实践

[英]iPhone / iPad Application image formatting best practices

We are using html5/webkit to style an iPhone application and the data coming into the application is coming from a blog. 我们使用html5 / webkit来设置iPhone应用程序的样式,进入应用程序的数据来自博客。 There are many variants regarding images sizes that are coming into the app, we would like to know what best practice is in regards to resizing images for each respective application (iPhone / iPad) 有关图像大小的许多变体都会进入应用程序,我们想知道有关为每个应用程序(iPhone / iPad)调整图像大小的最佳实践

Sample Post Images: 示例帖子图片:

  • Image 1: 500px by 300px 图1:500px乘300px
  • Image 2: 800px by 200px 图2:800px×200px
  • Image 3: 1024px by 768px 图3:1024px×768px

(some of these images would work well on an iPad but on iPhone will be too big for the viewable area. Should these images be resized using some type of jS/ html or is it best to resize these images server side. (其中一些图像在iPad上运行良好但在iPhone上对于可视区域来说太大了。如果使用某种类型的jS / html调整这些图像的大小,或者最好调整这些图像服务器端的大小。

All insight on be practice is greatly appreciated, thank you in advance! 非常感谢所有有关实践的见解,谢谢你提前!

JN JN

UPDATE 01/14/2012 An option that works very well for this is Sencha.src.io for rendering images in the size for the appropriate device: http://www.sencha.com/learn/how-to-use-src-sencha-io/ this is an option for getting up and running with a tool with many options. 更新01/14/2012一个适用于此的选项是Sencha.src.io,用于渲染适当设备大小的图像: http//www.sencha.com/learn/how-to-use-src -sencha-io /这是一个使用包含许多选项的工具启动和运行的选项。

This is more opinion than best practice. 这是比最佳实践更多的意见。

Server side rendering of the images would make sense to me for resources and load. 对于资源和负载,图像的服务器端渲染对我来说是有意义的。

Using a webserver to pre-render the images would likely be much faster because server-side languages (php/perl/ruby etc) are faster than javascript and don't require more client resources than simply rendering an image. 使用网络服务器预渲染图像可能会快得多,因为服务器端语言(php / perl / ruby​​等)比javascript更快,并且不需要比简单渲染图像更多的客户端资源。

In PHP I have used the $_SERVER superglobal to detect browser and platform to do exactly this. 在PHP中,我使用$ _SERVER超全局来检测浏览器和平台。 $_SERVER['HTTP_USER_AGENT']

or 要么

$browser = get_browser(null, true);

print_r($browser);

HTH HTH

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM