contentful-labs / concorde Goto Github PK
View Code? Open in Web Editor NEWDownload and decode progressive JPEGs on iOS.
License: MIT License
Download and decode progressive JPEGs on iOS.
License: MIT License
Is it possible to add support for iOS7? When doing pod install
, I see this lib only works on 8+. Thank you.
I want to develop the component in Java.But I can't find detailed description of ProgressiveJpeg format when searching on Google.Please guide me where I can get detailed information about ProgressiveJpeg.
When I try to include this in an iOS 9 project, I get errors about bitcode support not being available on a certain ARM architecture. As a result, I have to disable bitcode for my entire app.
Basically, just need to implement required public init(coder aDecoder: NSCoder)
instead of throwing a fatalError
.
Hi! We love your library! Very nice. The most interesting part in this project for me is the CCBufferedImageDecoder
in pair with the library. In my eyes the CCBufferedImageView.swift
is more like an example of how to integrate. Therefore I created this https://github.com/agens-no/CCBufferedImageDecoder
Ideally for me we would just change the podspec in this repo to either a) move the swift stuff into a subspec or b) remove the swift stuff or c) use one of the [ports].(https://github.com/ljfantin/Concorde/blob/feature/support_ios_7/Code/CCBufferedImageView.m).
Anyways, just though I should let you know.
Hello Boris!
What does CCDecodingStatusNextIteration mean? Does it simply mean that there's isn't enough information to fill the whole canvas and given more data it probably will?
Currently, a new instance of CCBufferedImageDecoder
is created for each new chunk of data received. Works, but we could be more efficient, especially considering that it'll allocate a new output buffer each time.
I have a tinder-like stack of images. Touch events are not delivered while big images gets loaded/decode.
Thats because you decode image with dispatch_sync
and it stops main_thread.
Can be based off this:
template <J_COLOR_SPACE colorSpace>
void setPixel(ImageFrame& buffer, ImageFrame::PixelData* currentAddress, JSAMPARRAY samples, int column)
{
JSAMPLE* jsample = *samples + column * (colorSpace == JCS_RGB ? 3 : 4);
switch (colorSpace) {
case JCS_RGB:
buffer.setRGBA(currentAddress, jsample[0], jsample[1], jsample[2], 0xFF);
break;
case JCS_CMYK:
// Source is 'Inverted CMYK', output is RGB.
// See: http://www.easyrgb.com/math.php?MATH=M12#text12
// Or: http://www.ilkeratalay.com/colorspacesfaq.php#rgb
// From CMYK to CMY:
// X = X * (1 - K ) + K [for X = C, M, or Y]
// Thus, from Inverted CMYK to CMY is:
// X = (1-iX) * (1 - (1-iK)) + (1-iK) => 1 - iX*iK
// From CMY (0..1) to RGB (0..1):
// R = 1 - C => 1 - (1 - iC*iK) => iC*iK [G and B similar]
unsigned k = jsample[3];
buffer.setRGBA(currentAddress, jsample[0] * k / 255, jsample[1] * k / 255, jsample[2] * k / 255, 0xFF);
break;
}
}
The title of this github repository is "Download and decode progressive JPEGs on iOS." But it doesn't do the very thing that Progressive JPEG was invented to do:
Progressively download and decode JPEGs on iOS
It misuses NSURLSession to grab ALL the data (a process that takes 99% of the total time) then decodes it.
Please rewrite to use NSURLSession in stream mode, so that is passed to your CGDataProvider in bursts, decoding what you can and writing it to the screen as the data comes in.
In CCBufferedImageDecoder , you create your CGDataProvider with an NSData, but by the time you have the NSData, 99% of the time of fetching and displaying the image has already elapsed, making progressive jpeg decoding pointless.
Currently blocked by "FBSnapshotTestCase" not building on 7.2 — "Use of private header from outside its module" for all imports of private headers in implementation (!) files.
适配一下swift5
💥
My images are currently flickering as they download.
Calling the .load
method seems to add some significant latency for images that should be cached.
Crashed: com.contentful.Concorde
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x00000000
Thread : Crashed: com.contentful.Concorde
0 libobjc.A.dylib 0x31e2af78 lookUpImpOrForward + 47
1 libobjc.A.dylib 0x31e2af3f _class_lookupMethodAndLoadCache3 + 34
2 libobjc.A.dylib 0x31e2af3f _class_lookupMethodAndLoadCache3 + 34
3 libobjc.A.dylib 0x31e311f9 _objc_msgSend_uncached + 24
4 Concorde 0x001f7a64 _TFFC8Concorde19CCBufferedImageView10connectionFS0_FTCSo15NSURLConnection14didReceiveDataCSo6NSData_T_U_FT_T_ + 372
5 libdispatch.dylib 0x3238540f _dispatch_client_callout + 22
6 libdispatch.dylib 0x3238e861 _dispatch_barrier_sync_f_invoke + 48
7 Concorde 0x001f62a8 _TToFC8Concorde19CCBufferedImageView10connectionfS0_FTCSo15NSURLConnection14didReceiveDataCSo6NSData_T_ + 304
8 CFNetwork 0x2410aeed __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke + 56
9 CFNetwork 0x2410aea7 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 182
10 CFNetwork 0x2410af99 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 36
11 CFNetwork 0x240f8a11 _NSURLConnectionDidReceiveData(_CFURLConnection*, __CFData const*, long, void const*) + 80
12 CFNetwork 0x2401deab ___ZN27URLConnectionClient_Classic29_delegate_didReceiveDataArrayEv_block_invoke + 158
13 CFNetwork 0x240bc76d ___ZN27URLConnectionClient_Classic18_withDelegateAsyncEPKcU13block_pointerFvP16_CFURLConnectionPK33CFURLConnectionClientCurrent_VMaxE_block_invoke_2 + 60
14 CFNetwork 0x24010d71 RunloopBlockContext::_invoke_block(void const*, void*) + 60
15 CoreFoundation 0x244c35a1 CFArrayApplyFunction + 36
16 CFNetwork 0x24010c2b RunloopBlockContext::perform() + 182
17 CFNetwork 0x24010af1 MultiplexerSource::perform() + 216
18 CFNetwork 0x2401098d MultiplexerSource::_perform(void*) + 48
19 CoreFoundation 0x24578fd7 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
20 CoreFoundation 0x245783eb __CFRunLoopDoSources0 + 222
21 CoreFoundation 0x24576a69 __CFRunLoopRun + 768
22 CoreFoundation 0x244c3b31 CFRunLoopRunSpecific + 476
23 CoreFoundation 0x244c3943 CFRunLoopRunInMode + 106
24 GraphicsServices 0x2b8a1051 GSEventRunModal + 136
25 UIKit 0x27ab5f21 UIApplicationMain + 1440
26 Chata de Galocha 0x00043e34 main (AppDelegate.swift:19)
Hello!
I have been trying to use Concorde in a iOS project with the following code:
if let url = NSURL(string: produto.imagem!.url!){
let imagem = CCBufferedImageView(frame: cell.imageView!.frame)
imagem.load(url)
cell.addSubview(imagem)
}
produto.imagem is a Contentful Asset and url value currently is:
url NSURL "https://images.contentful.com/765kywdqo8as/1u0UQOzrSEyAIYoY8CgaiU/743112ca52714a9739b7550fb83a43e2/3479738_wallsPetroleum_01.png" 0x00007feba3861590
When I execute my code I only get grey placeholders and never an image.
On the other hand I have tried using ContentfulPersistence with the following code:
let imagem = CCBufferedImageView(frame: cell.imageView!.frame)
imagem.cda_setImageWithPersistedAsset(produto.imagem!, client: source!.client, size: imagem.frame.size, placeholderImage: nil)
cell.addSubview(imagem)
Then I get the following error:
fatal error: should never be called: file /Users/rafael/Trabalho/Bier Leverpilsen/Pods/Concorde/Code/CCBufferedImageView+Contentful.swift, line 18
Any help would be appreciated! I have been struggling for a while!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.