Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into points_in_shapeEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
will-moore committed Apr 29, 2024
2 parents b69b2f6 + 6bdf72c commit e45b5c9
Show file tree
Hide file tree
Showing 11 changed files with 429 additions and 62 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 6.2.1.dev0
current_version = 6.2.3.dev0
commit = True
tag = True
sign_tags = True
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@

6.2.2 (April 2024)
------------------

- Avoid rendering very large planes when exporting Big images ([#553](https://github.com/ome/omero-figure/pull/553))


6.2.1 (April 2024)
------------------

- Fix loss of Zoom data with `Edit ID` feature ([#550](https://github.com/ome/omero-figure/pull/550))
- Fix labels in figures exported as TIFF ([#548](https://github.com/ome/omero-figure/pull/548))


6.2.0 (February 2024)
---------------------

Expand Down
12 changes: 6 additions & 6 deletions omero_figure/scripts/omero/figure_scripts/Figure_To_Pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ def draw_shape_label(self, shape, bounds):
return
r, g, b, a = self.get_rgba_int(shape['strokeColor'])
# bump up alpha a bit to make text more readable
rgba = (r, g, b, 128 + a / 2)
rgba = (r, g, b, int(128 + a / 2))
font_name = "FreeSans.ttf"
from omero.gateway import THISPATH
path_to_font = os.path.join(THISPATH, "pilfonts", font_name)
Expand All @@ -576,7 +576,7 @@ def draw_shape_label(self, shape, bounds):
box = font.getbbox(text)
width = box[2] - box[0]
height = box[3] - box[1]
xy = (center[0] - width / 2.0, center[1] - height / 2.0)
xy = (int(center[0] - width / 2.0), int(center[1] - height / 2.0))
self.draw.text(xy, text, fill=rgba, font=font)

def draw_arrow(self, shape):
Expand Down Expand Up @@ -1539,12 +1539,12 @@ def get_zoom_level_scale(self, image, region, max_width):
# e.g. {0: 1.0, 1: 0.25, 2: 0.0625, 3: 0.03123, 4: 0.01440}
# Pick zoom such that returned image is below MAX size
max_level = len(zm_levels.keys()) - 1

# Maximum size that the rendering engine will render without OOM
max_plane = self.conn.getDownloadAsMaxSizeSetting()
# Maximum size that the rendering engine will render
max_sizes = self.conn.getMaxPlaneSize()

# start big, and go until we reach target size
zm = 0
max_plane = max_sizes[0] * max_sizes[1]
while (zm < max_level and
zm_levels[zm] * width > max_width or
zm_levels[zm] * width * zm_levels[zm] * height > max_plane):
Expand Down Expand Up @@ -2277,7 +2277,7 @@ def draw_temp_label(self, text, fontsize, rgb):
box = font.getbbox(t['text'])
txt_w = box[2] - box[0]
txt_h = box[3] - box[1]
textdraw.text((w, 0), t['text'], font=font, fill=rgb)
textdraw.text((w, -box[1]), t['text'], font=font, fill=rgb)
w += txt_w
return temp_label

Expand Down
2 changes: 1 addition & 1 deletion omero_figure/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import json
import os

__version__ = "6.2.1.dev0"
__version__ = "6.2.3.dev0"


def read_file(fname, content_type=None):
Expand Down
Loading

0 comments on commit e45b5c9

Please sign in to comment.