iPhone / iPad 应用程序图像格式化最佳实践
我们正在使用 html5/webkit 来设计 iPhone 应用程序,进入应用程序的数据来自博客。应用程序中的图像大小有很多变体,我们想知道为每个应用程序 (iPhone / iPad) 调整图像大小的最佳实践是什么
示例帖子图像:
- 图像 1 :500px x 300px
- 图片 2:800px x 200px
- 图片 3:1024px x 768px
(其中一些图像在 iPad 上效果很好,但在 iPhone 上对于可视区域来说太大了。是否应该使用某种类型的 jS/ 来调整这些图像的大小html 还是最好在服务器端调整这些图像的大小。
非常感谢您对实践的所有见解,提前感谢您
JN
更新 01/14/2012 ! Sencha.src.io 是一个非常适合此目的的选项,用于以适合设备的尺寸渲染图像: http://www.sencha.com/learn/how-to-use-src-sencha-io/ 这是启动并运行有很多选项的工具。
We are using html5/webkit to style an iPhone application and the data coming into the application is coming from a blog. 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)
Sample Post Images:
- Image 1: 500px by 300px
- Image 2: 800px by 200px
- Image 3: 1024px by 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.
All insight on be practice is greatly appreciated, thank you in advance!
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这更多的是意见而不是最佳实践。
图像的服务器端渲染对我来说对于资源和负载来说是有意义的。
使用网络服务器预渲染图像可能会快得多,因为服务器端语言(php/perl/ruby 等)比 javascript 更快,并且不需要比简单渲染图像更多的客户端资源。
在 PHP 中,我使用 $_SERVER 超级全局来检测浏览器和平台来执行此操作。
$_SERVER['HTTP_USER_AGENT']
或
$browser = get_browser(null, true);
print_r($browser);
HTH
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.
In PHP I have used the $_SERVER superglobal to detect browser and platform to do exactly this.
$_SERVER['HTTP_USER_AGENT']
or
$browser = get_browser(null, true);
print_r($browser);
HTH