hypeDocument.setElementProperty(e, "background-image", "${resourcesFolderName}/" + cards['tea-cup'] );
When I verify the value of ${resourcesFolderName}, it is wrong. It says: index.hyperesources
In the editor using <img src=“url(’${resourcesFolderName}/” + cards[‘tea-cup’] + “’)” />
works good though.
You would need to uncheck ‘Automatically optimize while exporting’ for that image for that code to work. If you drop a PNG into Hype and there is no transparency, the file will be converted to a JPG if it will save space.
@Daniel
Still would be nice to set a document-wide default to “Never Optimize Images”.
Clicking this checkbox would disable “Automatically optimize” until the “Never Optimize Images” checkbox was deselected. I think this placement would be more obvious than a “Preferences” location.
Before I put in an official feature request - is there a reason I am overlooking why this feature would not be useful?
Not really, it is a good request! From this app developer's perspective the primary issue is more that it is in a blurry state between being a document option, an application option, and an export option: I don't want users to turn it off globally when it probably would be of significant benefit (you'll not believe the load times that many documents had from dragging in large photos) but also don't want the next-stage annoyance of having to check it for every document or for export slices.
Regardless, this has been thought of a lot and there is currently app-level "support" for it but no UI (in so much this is technically unsupported and may change!). You can fire up the /Applications/Utilities/Terminal.app and enter this command:
defaults write com.tumult.Hype4 newResourcesAreSetToAutoResize -bool NO
As the name implies this is only for newly added resources; existing ones must still be unchecked.
Thanks @Jonathan for the “Never optimize” Terminal command (any others lurking?)
The main annoyance is when You have a project with a lot of images (say 75+). When You drag new ones into the Resource panel they of course get mixed in with the others. Tracking these new additions down individually, often needing to scroll to find them, to turn off the “Optimize” checkbox is a PITA.
EDIT:
Another thought - what if, when images are dragged in to the Resource folder, they remained selected~highlighted so the check boxes at the bottom of the panel could be selected~deselected affecting just these new images? That would be a valuable enhancement.