{"id":21277978,"url":"https://github.com/b13/vh_imagedata","last_synced_at":"2025-07-14T13:12:56.634Z","repository":{"id":62490815,"uuid":"219468747","full_name":"b13/vh_imagedata","owner":"b13","description":"TYPO3 ViewHelper to build custom \u003cimg\u003e-Tag","archived":false,"fork":false,"pushed_at":"2021-02-03T11:38:40.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-09T23:38:58.234Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/b13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-04T09:55:11.000Z","updated_at":"2021-02-03T11:37:59.000Z","dependencies_parsed_at":"2022-11-02T11:16:13.490Z","dependency_job_id":null,"html_url":"https://github.com/b13/vh_imagedata","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fvh_imagedata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fvh_imagedata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fvh_imagedata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fvh_imagedata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b13","download_url":"https://codeload.github.com/b13/vh_imagedata/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243734438,"owners_count":20339292,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T10:08:31.263Z","updated_at":"2025-03-15T13:25:39.868Z","avatar_url":"https://github.com/b13.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EXT:vh_imagedata\n\n## Viewhelper to build custom `\u003cimg\u003e`-Tag\n\nThis viewhelper calculates an image based on `\u003cf:image\u003e` without rendering an image tag, making the data available in the\n content of the viewhelper for manual use or rendering custom image tags. The rendering takes all crop settings into \n account. \n \n### Basic useage example\n\n```\n\u003chtml xmlns:id=\"http://typo3.org/ns/B13/VhImagedata/ViewHelpers\" data-namespace-typo3-fluid=\"true\"\u003e\n\n\u003cid:imagedata src=\"{file.uid}\" treatIdAsReference=\"1\" width=\"300\" as=\"imageData\"\u003e\n    \u003cdiv class=\"b_lazyloading__background\" style=\"padding-bottom: {1 / imageData.ratio}%;\"\u003e\n        \u003cimg src=\"transparent.gif\" data-imageurl=\"{imageData.uri}\" width=\"{imageData.width}\" height=\"{imageData.height}\" \n            class=\"b_lazyloading__image bJS_lazyloading\" \n            alt=\"{imageData.alt}\" title=\"{imageData.title}\" /\u003e\n    \u003c/div\u003e\n\u003c/id:imagedata\u003e\n\n\u003c/html\u003e\n```\n\n### Allowed attributes\n\nThe following attributes can be passed to the ViewHelper. All attributes normally allowed for `f:image` can be passed\nbut not all make sense.\n\nArgument | Type | Info\n:--- | :--- | :---\nas | string | Name of variable to create. Defaults to `imageData`\nalt | string | Specifies an alternate text for an image'\ntitle | string | Tooltip text of element\nsrc | string | a path to a file, a combined FAL identifier or an uid (int). If $treatIdAsReference is set, the integer is considered the uid of the sys_file_reference record. If you already got a FAL object, consider using the $image parameter instead\ntreatIdAsReference | bool | given src argument is a sys_file_reference record\nimage | object | a FAL object\ncrop | string|bool | overrule cropping of image (setting to FALSE disables the cropping set in FileReference\ncropVariant | string | select a cropping variant, in case multiple croppings have been specified or stored in FileReference\nwidth | string | width of the image. This can be a numeric value representing the fixed width of the image in pixels. But you can also perform simple calculations by adding \"m\" or \"c\" to the value. See imgResource.width for possible options.\nheight | string | height of the image. This can be a numeric value representing the fixed height of the image in pixels. But you can also perform simple calculations by adding \"m\" or \"c\" to the value. See imgResource.width for possible options.\nminWidth | int | minimum width of the image\nminHeight | int | minimum width of the image\nmaxWidth | int | minimum width of the image\nmaxHeight | int | minimum width of the image\nabsolute | bool | Force absolute URL\nvalue | mixed | Value to assign. If not in arguments then taken from tag content\n\n\n### Returned data\n\nThe ViewHelper returns an array with all the image data as `{imageData}` or the variable name you set in argument `as`.\nThe array contains these values:\n\nKey | Info \n:--- | :---- \nwidth | Width of the rendered image \nheight | Height of the rendered image\nuri | URL of the image rendered\nalt | Alt tag for the image, taken from the sys_file_record, the sys_file_reference or from the \"alt\"-argument of the viewhelper\ntitle | Title tag for the image, taken from the sys_file_record, the sys_file_reference or from the \"title\"-argument of the viewhelper \nratio | The ratio of the cropped/rendered image (width / height), meaning 1.77777 for an image with 16:9 ratio\nheightRatio | The ratio of height to width, for use in inline styles of containers for responsive images\nlink | Value of the link field from sys_file_reference\nprocessingInstructions | Original processing instructions used for image rendering (including crop-values as array)\nprocessedImage | The processed file\noriginalImage | The original file \n\n## Installing\n\nUse Composer to add to your project:\n\n`composer require b13/vh_imagedata`\n\nSet the namespace the ViewHelper in your Fluid template where needed:\n\n```\n\u003chtml xmlns:id=\"http://typo3.org/ns/B13/VhImagedata/ViewHelpers\" data-namespace-typo3-fluid=\"true\"\u003e\n```\n\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb13%2Fvh_imagedata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb13%2Fvh_imagedata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb13%2Fvh_imagedata/lists"}