<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Evelio Tarazona on Medium]]></title>
        <description><![CDATA[Stories by Evelio Tarazona on Medium]]></description>
        <link>https://medium.com/@eveliotc?source=rss-e57e3c512c41------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*PZWJeUBJcOxPj31al2Ho2g.jpeg</url>
            <title>Stories by Evelio Tarazona on Medium</title>
            <link>https://medium.com/@eveliotc?source=rss-e57e3c512c41------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 05:17:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@eveliotc/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Scissors: an image cropping library for Android]]></title>
            <link>https://eng.lyft.com/scissors-an-image-cropping-library-for-android-a56369154a19?source=rss-e57e3c512c41------2</link>
            <guid isPermaLink="false">https://medium.com/p/a56369154a19</guid>
            <category><![CDATA[mobile-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Evelio Tarazona]]></dc:creator>
            <pubDate>Tue, 24 Nov 2015 20:10:27 GMT</pubDate>
            <atom:updated>2017-09-08T15:24:34.133Z</atom:updated>
            <content:encoded><![CDATA[<p>After <a href="http://blog.lyft.com/posts/profiles">we introduced profiles</a> a few months ago, Helen — an Engineer in one of our features team — was tasked to implement the second iteration of profiles for our Android app. This update to profiles included numerous improvements including the ability to set a custom profile picture, either from the camera or picking it from external applications like Gallery or Photos.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*An_iDXn6RtufzwUIdSUc-w.png" /><figcaption>Early designs for custom profile picture feature for the Lyft Android app.</figcaption></figure><p>Before uploading the picture to our servers it had to be cropped following certain requirements, among which were:</p><ul><li>Pinch to zoom up to 200%</li><li>Panning and snapping to the viewport</li><li>Maintaining a certain ratio regardless of screen density</li><li>Cropping based on current viewport dimensions</li></ul><p>At Lyft we love open source, so naturally we researched existing solutions. None of them fulfilled the requirements we needed so we decided to build our own. Fast forward a few months and we are now open sourcing the view that represents the core of this feature: <a href="https://github.com/lyft/scissors">Scissors</a>.</p><h3>Scissors</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*o9wj6y7Xt5zn6nHI4p5t7Q.png" /></figure><h4>What does it do?</h4><p><a href="https://github.com/lyft/scissors">Scissors</a> provides a view called <strong>CropView</strong>, which <em>extends</em> <a href="https://developer.android.com/reference/android/widget/ImageView.html">ImageView</a> offering familiar ways to provide a <em>Bitmap</em> to crop, for example, using <a href="https://developer.android.com/reference/android/widget/ImageView.html#setImageBitmap%28android.graphics.Bitmap%29">setImageBitmap</a>. Once the user has panned and zoomed around (constrained by <em>cropviewMaxScale</em> and <em>cropviewMinScale</em>) all you have to do is call</p><pre>Bitmap croppedBitmap = cropView.crop();</pre><p>The returned <em>Bitmap </em>matches the viewport dimensions, which can be controlled by using <em>cropviewViewportHeightRatio.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*SbhkZppPqhMwj4CdcrFS_w.gif" /><figcaption>Scissors sample using extensions in action</figcaption></figure><h4>Extensions</h4><p>We also added some handy extensions to help with common tasks like:</p><ul><li>Loading a <em>Bitmap</em> to fit the viewport using <a href="https://github.com/square/picasso">Picasso</a> or <a href="https://github.com/bumptech/glide">Glide</a> into <em>CropView</em></li></ul><pre>cropView.extensions()<br> .<strong>load</strong>(galleryUri);</pre><p>You can also create a custom <em>BitmapLoader</em> to provide a <em>Bitmap</em> just the way you want it.</p><ul><li>Saving a cropped <em>Bitmap </em>into a <em>File</em> or stream without blocking the main thread</li></ul><pre>cropView.extensions()<br> .<strong>crop</strong>()<br> .quality(87)<br> .format(PNG)<br> .into(croppedFile);</pre><p>You can also provide <em>format</em> and <em>quality</em> of resulting <em>File</em>/stream.</p><h4>Future work</h4><p>We want to make Scissors as sharp as possible so in the future we aim to <a href="https://github.com/lyft/scissors/issues/1">add double tap drag to zoom</a> support, among other <a href="https://github.com/lyft/scissors/issues/">fixes and optimizations</a>. We hope you find Scissors useful and it will become the library for all your image cropping needs.</p><p><a href="https://github.com/lyft/scissors"><strong>Get started with Scissors on Github</strong></a></p><blockquote>Interested in open source, Android and cool features? <a href="https://www.lyft.com/jobs#job-openings">Lyft is hiring</a>!</blockquote><blockquote>Drop me a note on <a href="https://plus.google.com/+EvelioTarazonaCaceres">Google+</a>, <a href="https://twitter.com/eveliotc">Twitter</a> or at evelio@lyft.com.</blockquote><p><strong>N E X T</strong> → <a href="https://eng.lyft.com/announcing-confidant-an-open-source-secret-management-service-from-lyft-1e256fe628a3#.p3mfvnysd"><em>Announcing Confidant, an open source secret management service from Lyft</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a56369154a19" width="1" height="1" alt=""><hr><p><a href="https://eng.lyft.com/scissors-an-image-cropping-library-for-android-a56369154a19">Scissors: an image cropping library for Android</a> was originally published in <a href="https://eng.lyft.com/">Lyft Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>