Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Welcome to the CollectiveAccess support forum! Here the developers and community answer questions related to use of the software. Please include the following information in every new issue posted here:

  1. Version of the software that is used, along with browser and version

  2. If the issue pertains to Providence, Pawtucket or both

  3. What steps you’ve taken to try to resolve the issue

  4. Screenshots demonstrating the issue

  5. The relevant sections of your installation profile or configuration including the codes and settings defined for your local elements.

If your question pertains to data import or export, please also include:

  1. Data sample

  2. Your mapping

Answers may be delayed for posts that do not include sufficient information.

Use px as unit


I would like to add a set of digitalized posters to my CA database. I am creating a "size" bundle with "width" and "height" fields as "Length" attributes. The point is that there is no description in the documentation to the "px" units.

Is there any way to add "px" as units?



  • edited January 19

    Only concrete units for length are supported currently. Adding support for pixels (px) is not impossible, but it's a little complicated. Unless we also add an accompanying resolution/density value there'll be no way to convert values in pixels to concrete units. This is a problem because everything around dimensions has been built on the assumption that values are convertible to metric. (Internally everything is stored as metric).

    Alternatively we might just assume that pixels are always converted to concrete units at a fixed resolution of 72 pixels per inch, which is how the conversion for points (a typographic length unit) work more or less. This seems like it'll just cause problems for someone later, though. Maybe I'm wrong.

    What do you think?

  • Thank you!

    I think there is a way to describe a px unit something like this: 200px@72dpi, and thus it can be converted to metric.

    I will have a look at the source code to evaluate the potential to develop it myself and then PR :smile:

  • Go for it. Happy to help if you need it. It'll be a nice feature.

    You'll want to start by looking at the fiile app/lib/Attributes/Values/LengthAttributeValue.php, and especially the parseValue() method in that class.

  • I think the point is on extending caParseLengthDimension@app/helpers/utilityHelpers.php to allow detecting the resolution part (something like "@72"). The code should convert the length value to the resolution and then return the suitable Zend_Measure_Length.

    What do you think?

  • That's probably the way I'd go.

Sign In or Register to comment.