You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The classifier's SubjectViewerStore records subject dimensions (clientHeight, clientWidth, naturalHeight, naturalWidth) whenever a subject image is loaded. It happens here:
However, since dimensions are pushed into an array, a new record of dimensions is added every time a multi-frame viewer switches frames (flipbook, text + image viewer, multiframe viewer for transcriptions). Because frame is also in the SubjectViewerStore, it updates and triggers a component re-render including a call of onSubjectReady() again and again.
Package
Choose from the list:
Describe the bug
Note that this was first reported in Daily Minor Planet. @lcjohnso Slack thread https://zooniverse.slack.com/archives/C0DTP3L2K/p1709678226020949.
The classifier's SubjectViewerStore records subject dimensions (
clientHeight
,clientWidth
,naturalHeight
,naturalWidth
) whenever a subject image is loaded. It happens here:front-end-monorepo/packages/lib-classifier/src/store/SubjectViewerStore/SubjectViewerStore.js
Lines 105 to 116 in d601d3f
However, since dimensions are pushed into an array, a new record of dimensions is added every time a multi-frame viewer switches frames (flipbook, text + image viewer, multiframe viewer for transcriptions). Because
frame
is also in the SubjectViewerStore, it updates and triggers a component re-render including a call ofonSubjectReady()
again and again.To Reproduce
Steps to reproduce the behavior:
This test flipbook project is also an optionFixedmetadata.subject_dimensions
like this:Expected behavior
There should only be one record of dimensions per subject.
The text was updated successfully, but these errors were encountered: