question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tiles outside the image are created

See original GitHub issue

I’ve noticed that sometimes a row or column is set on a tile that is outside of the image’s bounds. This originates from TileView.computeAndRenderTilesInViewport(): the grid is too large. This affects the Tile.mDestinationRect. Later in Tile.decode(), this same row and column is used to render a tile with mStreamProvider.getStream(). Is there a reason why these non-existing tiles are rendered?

The problem that I’m experiencing is that in my project the tiles are loaded with http requests, and our client’s server returns white tiles for invalid coordinates. True, this is just a bad design and the server should return an error or empty stream, but maybe other people have issues with this as well.

Thank you for maintaining this library the way you do and always being quick to answer, I appreciate it.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
inneke-dccommented, Jul 31, 2019

I think I got it but I’m not sure if it will cover all cases. It seemed to fix it for me in a layout where the image is centered in the TileView and where the scaling starts at a ‘fitCenter’ state:

tileView.setMinimumScaleMode(ScalingScrollView.MinimumScaleMode.CONTAIN) tileView.setScaleLimits(0f, 2f)

When changing the TileView.updateViewport() from

mViewport.right = mViewport.left + getMeasuredWidth(); mViewport.bottom = mViewport.top + getMeasuredHeight();

to

mViewport.right = mViewport.left + Math.min(getMeasuredWidth(), getScaledWidth()); mViewport.bottom = mViewport.top + Math.min(getMeasuredHeight(), getScaledHeight());

just the right amount of rows and columns are created.

I do not know what else will be affected by this however.

0reactions
moagriuscommented, Jul 31, 2019

This is awesome! Thanks so much for digging in. I may need to make some minor tweaks but this looks very promising - I’ll try to get his verified (and committed, hopefully) as soon as I get some time (I’ll shoot for Mon-Tues of next week - gone all weekend).

Thanks again! Nice open source-ery 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Permanent Custom Tiles - Pictured Tile: Home
We Print Your Image On Wall Tile, Floor Tile & Outdoor Tile & All Kinds Of Porcelain. Make your home or office STAND...
Read more >
"SystemError: tile cannot extend outside image" in PIL during ...
The error states * tile cannot extend outside image*, which means you are trying to crop a region beyond the dimension of the...
Read more >
Tiles You Can Use to Create Mosaic Tile Art Masterpieces
Today, mosaic tile art is still made into detailed images of people, ... If you plan to create a mosaic tile art outside,...
Read more >
60 Outdoor Tile ideas - Pinterest
Jan 16, 2018 - This board celebrates the numerous gorgeous ways that you can apply tile in the outdoors. Take a look!. See...
Read more >
Porcelain vs. Ceramic Outdoor Tile: What's the Difference?
Thinking of tiling your deck or patio? ... WILLSIE/Getty Images ... Porcelain tiles are made of a finer, more refined clay.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found