[haiku-commits] Re: haiku: hrev49072 - src/apps/showimage

  • From: Janus <janus2@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 21 Apr 2015 14:16:42 +0200


On 21 April 2015 at 10:43, Humdinger wrote:

On 21 April 2015 at 10:43, <janus2@xxxxxxxxx (mailto:janus2@xxxxxxxxx)> wrote:
e62a6973498c: ShowImage: Set width and height attributes of the showed
image.

* Fixes #8745

Nice to see you working on these usability improvements!
Wouldn't it save a few unecessary writes to only write those
attributes if they aren't already set or their value differ? Or would
that be a useless optimization since you'd have to additionally read
and compare those attributes first?

At the begin I thought to put the code in the ImageCache.
We could use the image attributes to predict the memory size of the image.
This would be useful when we are low on memory to decide if the image should be
preloaded (Now we use the average size of the images we already have in memory
(max 4 images)). But I think this will change in the future. So I just wrote
the simplest solution.
But your observation it’s correct so I’ll change the code.

Thanks, Janus


Other related posts: