Giter Site home page Giter Site logo

zlphotolib's Introduction

This is a photo album multiple-choice / photo browser example

新库 MLPhotoLib:

欢迎大家使用新的相册库(MLPhotoLib),兼容iOS7+,效率更高 效果更好~ MLPhotoLib


继承图片多选/图片浏览器一体

新特性:浏览器支持屏幕旋转、优化了数据源。

Browser Continued in ...

Demo Show

image image image

Recoder SelectedAssets/Limit SelectedAssets (记录/限制功能)

image

Not Power没权限

相册多选

// 创建图片多选控制器
ZLPhotoPickerViewController *pickerVc = [[ZLPhotoPickerViewController alloc] init];
// 默认显示相册里面的内容SavePhotos
pickerVc.status = PickerViewShowStatusSavePhotos;
// 选择图片的最小数,默认是9张图片最大也是9张
pickerVc.minCount = 4; 
[pickerVc show];

// block回调或者代理
// 用block来代替代理
pickerVc.delegate = self;    
/**
 *
 传值可以用代理,或者用block来接收,以下是block的传值
 __weak typeof(self) weakSelf = self;
 pickerVc.callBack = ^(NSArray *assets){
    weakSelf.assets = assets;
    [weakSelf.tableView reloadData];
 };
 */    

// 代理回调方法
- (void)pickerViewControllerDoneAsstes:(NSArray *)assets{
  self.assets = assets;
  [self.tableView reloadData];
}

ZLPhotoPickerBrowserViewController 图片游览器

ZLPhotoPickerBrowserViewController *pickerBrowser = [[ZLPhotoPickerBrowserViewController alloc] init];
// 传入点击图片View的话,会有微信朋友圈照片的风格
pickerBrowser.toView = cell.imageView;
// 数据源/delegate
pickerBrowser.delegate = self;
pickerBrowser.dataSource = self;
// 是否可以删除照片
pickerBrowser.editing = YES;
// 当前显示的分页数
pickerBrowser.currentIndexPath = indexPath;
// 展示控制器
[pickerBrowser show];

Contact

@weibo : 我的微博

License

ZLPhotoLib is published under MIT License

Copyright (c) 2015 MakeZL (@MakeZL)

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

zlphotolib's People

Contributors

hongdong avatar huzhenchao avatar larryonline avatar makezl avatar xuxie avatar zhugexiaobo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zlphotolib's Issues

我想选择返回原图。。。

我想选择相册图片,然后返回原始图,而不是略缩图,有方法设置吗?如果没有的话在看哪个文件哪个代码改?谢谢

相册多选照片,预览的时候这样操作会崩溃

设备iPhone5s ,ios 8.1
在相册中多选照片的时候,选择的照片会展示在下面的一个横向预览scrollview上,5s的屏幕可以显示5张预览图,当选择的照片超过一定数量后scrollview的滑动会开启(>=6张),这时候选择最后一张然后点击进入图片浏览器浏览,再点一下返回缩略图的过程中会直接崩溃

因考虑兼容iOS9, 会另开一个库来开发新的iOS9的库, 谢谢您的支持

因苹果在iOS8不建议使用ALAssetLibrary, 并在iOS9.3 ipad上会拿不到缩略图,这个库暂时做了兼容的办法,考虑这个库比较老,很多方法不方便改,新建一个库来维护,并删除了之前一些分开的库,因为很多方法与思路并不好,总之我会尽力去维护做到更好,谢谢你们!

单选的时候,点击再取消点击会crash

[self.toolBarThumbCollectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:self.selectAssets.count-1 inSection:0] atScrollPosition:UICollectionViewScrollPositionNone animated:YES];

此时self.selectAssets.count的个数为0

Bad access

When I run demo in really iPhone6 and click "select photos button", I get error in ZLPickerAssetsViewController,

Method:

  • (UIButton *)doneBtn{
    if (!_doneBtn) {

Can you fix this? Thx!

话说ZLPhotoPickerViewController的minCount不应该是maxCount吗?

ZLCameraViewController里用的倒是maxCount。。。。

// 创建图片多选控制器
ZLPhotoPickerViewController *pickerVc = [[ZLPhotoPickerViewController alloc] init];
// 默认显示相册里面的内容SavePhotos
pickerVc.status = PickerViewShowStatusSavePhotos;
// 选择图片的最小数,默认是9张图片最大也是9张
pickerVc.minCount = 4;
[pickerVc show];

提供push方式浏览

能否在进行图片(视频)浏览的时候提供一种,push方式查看照片,单击图片时,隐藏navigationbar

Hi 关于拍照的数量无法控制

Example0 设置的最大照片数仅仅可以限制直接选择的照片数,如果是照相找的多于9还是可以传出去使用的,可以修复么?
snip20160503_222
snip20160503_223

回收图片时候,图片会错位

回收图片的时候,图片并没有回到原位,而是跑到上方,然后再闪回到原位,还有就是打开正方形图片的时候,会卡顿一下,然后才撑满屏幕

提供push方式浏览图片

能否在进行图片浏览的时候提供一种,push方式查看照片,单击图片时,隐藏navigationbar

xcode7下进度条崩溃

2015-10-31 12:35:54.803 YS[3182:30337] This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes. This will cause an exception in a future release.
Stack:(
0 CoreFoundation 0x000000010be0cf45 exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010adb6deb objc_exception_throw + 48
2 CoreFoundation 0x000000010be0ce7d +[NSException raise:format:] + 205
3 Foundation 0x000000010ab2c289 _AssertAutolayoutOnMainThreadOnly + 79
4 Foundation 0x000000010a98ccce -[NSISEngine withBehaviors:performModifications:] + 31
5 UIKit 0x000000010d596d4a -[UIView(Hierarchy) _postMovedFromSuperview:] + 575
6 UIKit 0x000000010d594d53 __UIViewWasRemovedFromSuperview + 213
7 UIKit 0x000000010d594905 -[UIView(Hierarchy) removeFromSuperview] + 422
8 YS 0x0000000108060068 -[ZLPhotoPickerBrowserPhotoScrollView setProgress:] + 296
9 YS 0x000000010805fc7e __48-[ZLPhotoPickerBrowserPhotoScrollView setPhoto:]_block_invoke174 + 62
10 YS 0x00000001081ea4b1 __72-[SDWebImageDownloader downloadImageWithURL:options:progress:completed:]_block_invoke_2 + 897
11 YS 0x000000010811464b -[SDWebImageDownloaderOperation connection:didReceiveData:] + 2715
12 CFNetwork 0x000000010a2819ae __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke + 69
13 CFNetwork 0x000000010a281952 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 199
14 CFNetwork 0x000000010a281aa7 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 48
15 CFNetwork 0x000000010a2561d0 _ZL30_NSURLConnectionDidReceiveDataP16_CFURLConnectionPK8__CFDatalPKv + 79
16 CFNetwork 0x000000010a0ec72b ___ZN27URLConnectionClient_Classic29_delegate_didReceiveDataArrayEv_block_invoke + 293
17 CFNetwork 0x000000010a1dd5eb ___ZN27URLConnectionClient_Classic18_withDelegateAsyncEPKcU13block_pointerFvP16_CFURLConnectionPK33CFURLConnectionClientCurrent_VMaxE_block_invoke_2 + 100
18 libdispatch.dylib 0x000000010ec0c49b _dispatch_client_callout + 8
19 libdispatch.dylib 0x000000010ebee54b _dispatch_block_invoke + 716
20 CFNetwork 0x000000010a0db6f0 _ZN19RunloopBlockContext13_invoke_blockEPKvPv + 24
21 CoreFoundation 0x000000010bd0c4c4 CFArrayApplyFunction + 68
22 CFNetwork 0x000000010a0db5e9 _ZN19RunloopBlockContext7performEv + 137
23 CFNetwork 0x000000010a0db4a2 _ZN17MultiplexerSource7performEv + 282
24 CFNetwork 0x000000010a0db2c4 _ZN17MultiplexerSource8_performEPv + 72
25 CoreFoundation 0x000000010bd39011 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION
+ 17
26 CoreFoundation 0x000000010bd2ef3c __CFRunLoopDoSources0 + 556
27 CoreFoundation 0x000000010bd2e3f3 __CFRunLoopRun + 867
28 CoreFoundation 0x000000010bd2de08 CFRunLoopRunSpecific + 488
29 CoreFoundation 0x000000010bde0ff1 CFRunLoopRun + 97
30 YS 0x0000000108112559 -[SDWebImageDownloaderOperation start] + 1913
31 Foundation 0x000000010a949c47 __NSOQSchedule_f + 194
32 libdispatch.dylib 0x000000010ec0c49b _dispatch_client_callout + 8
33 libdispatch.dylib 0x000000010ebf28ec _dispatch_queue_drain + 2215
34 libdispatch.dylib 0x000000010ebf1e0d _dispatch_queue_invoke + 601
35 libdispatch.dylib 0x000000010ebf4a56 _dispatch_root_queue_drain + 1420
36 libdispatch.dylib 0x000000010ebf44c5 _dispatch_worker_thread3 + 111
37 libsystem_pthread.dylib 0x000000010ef3da9d _pthread_wqthread + 729
38 libsystem_pthread.dylib 0x000000010ef3b3dd start_wqthread + 13
)

PhotoBrower

Collection中显示图片,点击图片调用PhotoBrower,点击collection的最后一张图片图片查看器中的CellForItemAtIndexPath总会被调用两次,显示的索引值分别为0和最后一张图所对应的索引。这导致的后果是,当图片是从网络加载时,启动PhotoBrower时,将不使用Fade动画,使点击最后一张图时,显示第一张和最后一张,第一张闪过。

横竖屏自适应

感谢大神分享,提议一下, 能抽时间改下横竖屏自适应吗 , 包括图片浏览 、相册选择那些功能 。

AssetsLibrary和Photos照片框架兼容问题

Dear ZL:
ios9.0以上,苹果建议使用Photos替代AssetsLibrary了,而且AssetsLibrary在9.0以上确实有些坑。我已经在我的项目中,将您的库加入了Photos兼容处理,但感觉不是很完美!
可否请你在demo中,加入一下对Photos库的兼容??
THX!!

照片浏览器小图双击放大有问题

在照片浏览器里面,尺寸可以贴到屏幕边缘的图双击没有问题。贴不到屏幕边缘的小图双击放大会跑到屏幕外面无法再单击图片退出

在使用拍照的时候崩了

我是在使用pad真机运行的时候, 点击拍照上面第二个闪电按钮的时候崩溃的,崩溃在

  • (void) closeFlashlight:(UIButton )sender{
    // self.device.torchMode == AVCaptureTorchModeOff 判断
    [self flashLightModel:^{
    [self.device setTorchMode:AVCaptureTorchModeOff];//这一行
    }];
    }
    崩溃信息为
    相册Demo[12257:5168757] *
    * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[AVCaptureVideoDevice setTorchMode:] - the passed torchMode 0 is not supported by the device. Use -isTorchModeSupported: to discover valid torch modes.'
    *** First throw call stack:
    (0x1812f9900 0x180967f80 0x187584da0 0x100097664 0x100097290 0x1000975d4 0x186023e50 0x186023dcc 0x18600ba88 0x1860236e4 0x186023314 0x18601be30 0x185fec4cc 0x185fea794 0x1812b0efc 0x1812b0990 0x1812ae690 0x1811dd680 0x1826ec088 0x186054d90 0x1000857f0 0x180d7e8b8)
    libc++abi.dylib: terminating with uncaught exception of type NSException

图片浏览器页面假死

进入图片浏览器,连续两次快速缩放任意一张图片后,有很大几率造成不能左右滑动,造成页面卡死的假象,但是能缩放,再次缩放后无任何问题
造成bug的缩放方式:先放大,再快速缩小,再放大,再快速缩小。

IOS7下图片浏览器会闪烁和错位

机型:iphone5s(必须真机)
系统:7.0.4
操作步骤:

  • 点击图片进入浏览器
  • 点击右上角的删除按钮,图片会开始闪烁
  • 关掉当前图片再重新进入左右滑动几次后图片会显示错位

放大查看头像是否能想微信头像一样

类似微信一样,头像在cell上,点击时占位图为imageview小图,放大为服务器图片地址,现在在cell上点击有问题,不知道是否跟navigation的translucent属性有关

你好

关于你库里bundle内照片的名字能不能规范点啊...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.