How can resize the image with user defined names with user defined folder in typo3 - typo3

I have a typo3 site.
Where i need to resize the images with user defined names and then store it in a folder
Any idea how can we do this ?

Maybe this TypoScript option helps:
config.meaningfulTempFilePrefix = 1
Now when resizing an image and by this storing the resulting file in typo3temp the filename won't be gibberish only but still containing the original filename.
http://wiki.typo3.org/TSref/CONFIG

Related

Edit Custom Metadata on a JPG file - Live Photo

I am trying to edit a custom metadata value of a JPG file (static image of a Live Photo created by iPhone). Tried the exiftool but it doesnt work for me.
For reference this is the metadata of one of the file - https://www.metadata2go.com/result/93287b28-1c16-4491-affe-8ffbd6d9dd1a
the field I would like to edit and update is
Content Identifier DF64C2AE-ED3C-4778-BFCA-C15277E521D2
I tried updating the field with exiftool
exiftool -ContentIdentifier=5A0FFB8D-5410-4464-A343-61AE4A6C1109
LW16.jpg
It always throw error like file cannot be read or Warning: Tag 'ContentIdentifier' is not defined
Nothing to do.
Anyone can help me with this or guide me with another method to change the value ?

tinyMCE - is it possible to prevent the cut and paste of images (base64) in the textbox?

TinyMCE 4: I have implemented the image file/upload from local source, using php to save the uploaded file into a directory, with tinyMCE referencing this image. Works fine. This leaves a simple html text file to save in the database.
However, I see that the user can just cut and paste an image directly into the textbox, resulting in the image showing up and becoming a base64 image string, which defeats the purpose of storing only html text. Now the text could become extremely long if this base64 image is not prevented.
Is there a way to prevent this image paste action in tinyMCE? Or better yet, a way to automatically convert this paste into an image file and have it stored in the same place as the other images on the fly?
I know I could convert base64 images to a jpg files and store after submitting the form to a php handler, but would seek a simpler answer if possible.
The documentation is your friend for this issue. TinyMCE can certainly help you convert the images on the fly as they are pasted into the editor:
https://www.tinymce.com/docs/advanced/handle-async-image-uploads/
You can also stop the images from appearing in the first place if that is your preference:
https://www.tinymce.com/docs/plugins/paste/#paste_data_images

typo3 flexslider should user original image and not cropped one

In my typo3 7.6.19 Website I want to user the flexslider plugin.
That works fine, my problem is that the image is a cropped one and not the original file I uploaded.
How can I change it to use the original picture?
Thanks in advance
The plugin sets up a TypoScript constant
plugin.tx_wsflexslider.maxwidth=800px
You can modify this value in your TypoScript template (Module Template > Constant Editor > select "PLUGIN.TX_WSFLEXSLIDER"
About your other problem that is artifacts in the reduced image, I think that when resizing an image from 2550px to 800px, it is probable that the quality will be reduced :) You could check those settings in Install Tool >All Configuration > Image Processing [GFX] and see if you can improve them.
A last word: I would not use images of 2550px, it seems that they will be very heavy! I would try to set a compromise (e.g. plugin.tx_wsflexslider.maxwidth=1200px).
You could also evalutate the extension EXT:image_autoresize https://extensions.typo3.org/extension/image_autoresize/
to automatically resize the images when uploading them and limit the weight or dimensions of the images that your editor will upload.
From this answer typo3 uses crop images how can I avoid this I see that (of course) you can also modify the partial that renders the image and avoid using the TypoScript constants at all, but for the reasons I mentioned above, I would not recommend it.
In TYPO3 10.4.x and ws_slider 0.9.8, it was not a constant but:
<f:image image="{item.foregroundMedia.0}" maxWidth="600" />
in
Resources/Private/Partials/Item/Flexslider.html

Export pagetree with images?

Is it possible to export a pagetree to .t3d with images? Images are embedded as "Text & Images" elements. I could export pages, but images didn't follow.
Images has to be moved separately to the same path (either in fileadmin or in uploads) in order to do a proper export/import. If you check the file, all file paths are there in the export.
Source:
https://wiki.typo3.org/Faq/copy_parts_of_a_running_TYPO3_system_to_another_server

How to handle correctly converting images to thumbnails

I'm building out an admin area for an ecommerce site where the user can create a new product and upload multiple images to be used for the product. I have a table that lists all of the products, each row shows the first image returned from the database. I can scale down a large image to 100px x 100px but the user is still downloading a big image, not a true thumbnail.
I see two ways of doing this:
1. I can make the user choose which img will be the thumbnail so that the regular img is upload and also a smaller version of the file.
2.I can create thumbnails for every img that is uploaded and append to the filename of the thumbnail img so that I can return the first image that ends with a certain string.
Is there a more elegant way to do this or am I on the right track?
Create a cache directory, then create a script called something like image.php. Link your images like this
<img src="image.php?path=images/img.png&width=100&height=100">
Then in image.php, it should first check in the cache directory if the file exists.
Call the file "img.png&width=100&height=100" and save it in the cache directory. That way you can easily check if it exists, but there is enough entropy for someone to change it to width=101 and height = 101 so that the image will be regenerated.
Each time you create the thumbnail, just store it in the cache directory. If it exists, do a header() call and an echo file_get_contents() and then die().