|
@@ -12,12 +12,13 @@ use super::common;
|
|
use crate::{ResultExt, Settings};
|
|
use crate::{ResultExt, Settings};
|
|
use icns;
|
|
use icns;
|
|
use image::png::{PNGDecoder, PNGEncoder};
|
|
use image::png::{PNGDecoder, PNGEncoder};
|
|
-use image::{self, GenericImage, ImageDecoder};
|
|
|
|
|
|
+use image::{self, GenericImageView, ImageDecoder};
|
|
use std::collections::BTreeSet;
|
|
use std::collections::BTreeSet;
|
|
use std::ffi::OsStr;
|
|
use std::ffi::OsStr;
|
|
use std::fs::{self, File};
|
|
use std::fs::{self, File};
|
|
use std::io::Write;
|
|
use std::io::Write;
|
|
use std::path::{Path, PathBuf};
|
|
use std::path::{Path, PathBuf};
|
|
|
|
+use std::convert::TryInto;
|
|
|
|
|
|
pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
|
|
pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
|
|
common::print_warning("iOS bundle support is still experimental.")?;
|
|
common::print_warning("iOS bundle support is still experimental.")?;
|
|
@@ -74,8 +75,9 @@ fn generate_icon_files(bundle_dir: &Path, settings: &Settings) -> crate::Result<
|
|
if icon_path.extension() != Some(OsStr::new("png")) {
|
|
if icon_path.extension() != Some(OsStr::new("png")) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- let mut decoder = PNGDecoder::new(File::open(&icon_path)?);
|
|
|
|
- let (width, height) = decoder.dimensions()?;
|
|
|
|
|
|
+ let mut decoder = PNGDecoder::new(File::open(&icon_path)?)?;
|
|
|
|
+ let width = decoder.dimensions().0.try_into().unwrap();
|
|
|
|
+ let height = decoder.dimensions().1.try_into().unwrap();
|
|
let is_retina = common::is_retina(&icon_path);
|
|
let is_retina = common::is_retina(&icon_path);
|
|
if !sizes.contains(&(width, height, is_retina)) {
|
|
if !sizes.contains(&(width, height, is_retina)) {
|
|
sizes.insert((width, height, is_retina));
|
|
sizes.insert((width, height, is_retina));
|