<p dir="auto"><strong>Glide Version</strong>:<br>
4.1</p>

<p dir="auto"><strong>Integration libraries</strong>:</p>

<p dir="auto"><strong>Device/Android Version</strong>:</p>

<p dir="auto"><strong>Issue details / Repro steps / Use case background</strong>:</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/sjudd/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/sjudd">@sjudd</a><br>
It seems <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/bumptech/glide/commit/9d10097e7bd298cc5b393364663fa0cf08711e8e/hovercard" href="https://github.com/bumptech/glide/commit/9d10097e7bd298cc5b393364663fa0cf08711e8e"><tt>9d10097</tt></a> does not take in account the fact that a request is completed. So restarting a request that is completed will actually do nothing.</p>
<p dir="auto">Maybe this is on purpose but this implies a side effect of preventing a force reload when needed and does not trigger any listener.</p>
<p dir="auto">For example in my case when doing transition my fetcher only load the image from cache to avoid slowing down the transition. Then after the transition start a full download by restarting the glide query. (I'm pretty sure it would be the same for any app that would for example restart the requests after network is connected when first one occurred without network).</p>
<p dir="auto">With 3 and 4.0 it works correctly, but with 4.1 the subsequent query is not restarted preventing the actual load to happens and do not trigger any listener to warn the application.</p>
<p dir="auto">Cheating with different models could work, but then when the image is actually already cached it would trigger a real reload and not a memory hit cache as Glide think it's different items.</p>
<p dir="auto">I understand the purpose of the optimization but impact are not neutral if the completed state is not taken in account.</p>
<p dir="auto">Maybe by default if state is completed then the request should restart, and an option to always prevent restart provided. Or add an option to force the reload. Or a new Listener event so app can cheat (But for this one impact may be huge on API clients).</p>
<p dir="auto">Can PR something but need your choice and target. (And maybe an hint for the detection of completed state)</p>
<p dir="auto">Default should maybe work like actual, or maybe add something in the documentation, as the total ignore of the request may trouble clients to actually understand what is happening.</p>
<p dir="auto"><strong>Glide Version/Integration library (if any): 3.5.2<br>
Device/Android Version: Sony Xperia T / 4.1, Samsung S3 mini / 4.2<br>
Issue details/Repro steps:</strong></p>
<p dir="auto">Loading .webp images results in black image loaded. Images are loaded from Internet<br>
using thumbor. If they are loaded from local file all works fine.<br>
I am using Pollexor to create thumbor urls. Here is example code:</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="final String format = Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.ICE_CREAM_SANDWICH ? &quot;webp&quot; : &quot;jpeg&quot;;

final String thumborUrl = Thumbor
        .create(ConstantsApi.THUMBOR_URL)
        .buildImage(imageUrl)
        .filter(String.format(Locale.US, &quot;format(%s)&quot;, format))
        .filter(String.format(Locale.US, &quot;quality(%d)&quot;, 50))
        .resize(downloadWidth, downloadHeight)
        .fitIn()
        .toUrl();

Glide.with(this)
        .load(thumborUrl)
        .into(imageView);"><pre class="notranslate"><span class="pl-k">final</span> <span class="pl-smi">String</span> <span class="pl-s1">format</span> = <span class="pl-smi">Build</span>.<span class="pl-c1">VERSION</span>.<span class="pl-c1">SDK_INT</span> &gt;= <span class="pl-smi">Build</span>.<span class="pl-c1">VERSION_CODES</span>.<span class="pl-c1">ICE_CREAM_SANDWICH</span> ? <span class="pl-s">"webp"</span> : <span class="pl-s">"jpeg"</span>;

<span class="pl-k">final</span> <span class="pl-smi">String</span> <span class="pl-s1">thumborUrl</span> = <span class="pl-smi">Thumbor</span>
        .<span class="pl-en">create</span>(<span class="pl-smi">ConstantsApi</span>.<span class="pl-c1">THUMBOR_URL</span>)
        .<span class="pl-en">buildImage</span>(<span class="pl-s1">imageUrl</span>)
        .<span class="pl-en">filter</span>(<span class="pl-smi">String</span>.<span class="pl-en">format</span>(<span class="pl-smi">Locale</span>.<span class="pl-c1">US</span>, <span class="pl-s">"format(%s)"</span>, <span class="pl-s1">format</span>))
        .<span class="pl-en">filter</span>(<span class="pl-smi">String</span>.<span class="pl-en">format</span>(<span class="pl-smi">Locale</span>.<span class="pl-c1">US</span>, <span class="pl-s">"quality(%d)"</span>, <span class="pl-c1">50</span>))
        .<span class="pl-en">resize</span>(<span class="pl-s1">downloadWidth</span>, <span class="pl-s1">downloadHeight</span>)
        .<span class="pl-en">fitIn</span>()
        .<span class="pl-en">toUrl</span>();

<span class="pl-smi">Glide</span>.<span class="pl-en">with</span>(<span class="pl-smi">this</span>)
        .<span class="pl-en">load</span>(<span class="pl-s1">thumborUrl</span>)
        .<span class="pl-en">into</span>(<span class="pl-s1">imageView</span>);</pre></div>
<p dir="auto">The problem only occurs on pre 4.4.2 devices.<br>
Here is a sample thumbor image to test:<br>
<a href="http://img.jafolders.com/unsafe/fit-in/1057x1500/filters:format(webp):quality(100)/http://jafolders.com/uploads/pages/551c0648733100679823e70a/normal_image_1427899988.jpg" rel="nofollow">http://img.jafolders.com/unsafe/fit-in/1057x1500/filters:format(webp):quality(100)/http://jafolders.com/uploads/pages/551c0648733100679823e70a/normal_image_1427899988.jpg</a></p>
<p dir="auto">I've tested it same way but using Picasso and it works.</p>
<p dir="auto">I hope for quick response as it is very important bug for me that needs to be quickly repaired.</p>