I inherited a project with drupal and flash, and I'm pretty noobish on the topic so please don't bash me.
What I'm stuck at is that I need to create multiple thumbnails for each uploaded image (5 version to be precise with different settings eg. 150w, 250w,..) I created the presets but I can't seem to understand how imagecache works: it looks like the module builds the thumbnails only after I firs see the images, problem is that after I create the node I'm greeted with this view:
as you may notice some of the fields can have multiple images.
If I'm correct in my assumption that imagecache only builds thumb when you first access the node why I can't see the images but only the icons? Alternatively is it possible to force imagecache to create the different sizes as soon as the images are uploaded?
If not how does imagecache works?
Thanks
Imagecache only creates the thumbnails when they are requested the first time, but that should not result in this problem. Check if in your content type (under "display fields") the filefield containing the images is set to display an imagecache preset, not something like "Generic Files".
Related
I've been using ckeditor4 for ages in my custom CMS and I've just integrated ckfinder3 so I can use drag & drop image uploading via ckeditor4. Everything is working properly and I have it resizing images upon upload (set in ckfinder/config.php) - all good.
My issue is I want it to create a thumbnail of the image too, as it did in the past (I've been using an earlier version of ckfinder). They used to be uploaded to userfiles/_thumbs/images/ but now it doesn't seem to do it.
I have a few custom bits set up for my editor such as a custom config file and custom contents.css but they shouldn't have any effect on this. My editor code from within my CMS is below, all pretty straightforward stuff and it all works except for the fact that uploading images using drag & drop doesn't create a thumbnail too.
A point to note that if clicking on the 'image' button on the ckeditor toolbar, then uploading the usual way - browse server/upload etc, the system does create a thumbnail and places it in the folder here: userfiles/.ckfinder/cache/thumbs/images/theUploadedImage/theUploadedImage.jpg
Any pointers would be gratefully received. I hope this makes sense!
Thanks
<textarea name="blog_text"></textarea>
<script>
CKEDITOR.replace( 'blog_text', {
customConfig: 'mycustomfolder/myconfig.js',
contentsCss: CKEDITOR.getUrl( 'mycustomfolder/mycontents.css' ),
filebrowserBrowseUrl: 'ckfinder3.4.5/ckfinder.html',
filebrowserImageBrowseUrl: 'ckfinder3.4.5/ckfinder.html?type=Images',
filebrowserUploadUrl: 'ckfinder3.4.5/core/connector/php/connector.php?command=QuickUpload&type=Files',
filebrowserImageUploadUrl: 'ckfinder3.4.5/core/connector/php/connector.php?command=QuickUpload&type=Images'
} );
</script>
The paths and the methods of creating them were chnaged in CKFinder 3. Assuming that you are using default configuration, all thumbnails are being created inside /userfiles/.ckfinder/cache/thumbs/ folder and are on CKFinder private use only. They actually were for private use in CKF 2.x as well but users liked to abuse that.
Thumbnails get also created if you use, available in Popup and CKEditor integrations, "Choose Scaled" option. In that case scaled image gets created inside /MainFilesFolder/resourceTypeFolder/__thumbs/NameOfImage.extension/NameOfImage__widthxheight.extension e.g. /userfiles/images/__thumbs/Students.jpg/Students__480x320.jpg.
You can somewhat change the location of private directory through https://ckeditor.com/docs/ckfinder/ckfinder3-php/configuration.html#configuration_options_privateDir but please note that end of path resourceTypeName/theUploadedImage/theUploadedImage.jpg will not change.
There is also a simple plugin available online which allows generating thumbs on file upload. Perhaps this is something that might suit you or something that can be used as a jump start to create your own custom plugin: https://gist.github.com/zaak/7bb61025bfd9d3a6633029b0b4b087f9.
Well this is the only problem that bugs me a lot every time I create a CMS.
Say I have included the functionality to add some images with text (Not a image gallery) . This is the create function of CRUD. The read and delete are also not very difficult. The only problem I face is with the update function.
How should the image update be handled. How can I know that if the user wants to change the image and later if he submits a new image.
If he checks to change the image and uses the same image to upload, it would be useless to first unlink the previous image and upload the same image again.
How are these kind of things handled?
At this moment I am using codeigniter for Development.
Most CMS's will have image functionality baked in. I'd first suggest not trying to reinvent the wheel here.
In ExpressionEngine for example (on a codeigniter backend) you're givin a 'field tag' <img src="{{channel.img}}" />
The CMS is smart enough on the backend to change that field's value on update without you having to manually do anything. The only issue is if it overwrites the image name/location rather than created a new image in the uploads and leaving the previous one in there.
This is how it's handled in Umbraco CMS as well.
What else do you need?
I've got the PyroStreams module for PyroCMS and made a stream called portfolio. Everything is working as expected, however it only allows to upload just one image for my file field. That is obvious, but I'd like to know if there's a way to upload multiple images for one stream entry without adding x number of extra file fields. Or do I need to code an extra field type myself to support this? Maybe someone's got it already?
Thanks
According to me you have to create a separate database table that will hold all the images those are related to particular portfolio and the portfolio id by id by which you can fetch the images for particular record and then use any multiple image upload library like http://www.plupload.com/example_queuewidget.php to upload multiple images in the portfolio image table. Hopefully this will help you in achieving what you want.
There's a multi-upload files field type available on the pyrostore.
I'm using regular imagefields on various content types in a Drupal 7 social website (and also on the user profile pictures via http://drupal.org/project/imagecache_profiles). For cropping I'm using http://drupal.org/project/imagecrop as an image style effect.
I would like to replace the original image with the one generated from the imagecrop style. How do you replace the original image from a user (the one that gets used for subsequent image styles when you say call it in views) with one that is created from an image style effect?
I'm not sure the best way to approach this problem, which is why I posted question.
To make sure I'm being clear -
A User uploads a large image (say 2,000 pixels by 1300 pixels) via a regular imagefield.
Using image styles, I perform some effects (specifically javascript crop, but this could be generic) and then replace the original image with the one generated from the image style.
All additional image styles (different sizes etc) use the new original images and are derived from it.
I think this can be done easily using a custom module and they must have used something like the image editor project - See drupal.org/project/imageeditor, just not sure what hooks to use or how to jump in on this. Any advice, tips or direction would be great.
Check module - Original image with style
I believe you can address your problem by making changes under the display settings for your field:
/admin/structure/types/manage/[your content type machine name here]/display
I have images uploaded in the media library in WordPress. I would like to show the images with text composited on top of them using PHP's GD or something similar.
If this were just a plain old PHP site, I could create a URL with a search parameter for the text and center it over my image with GD and serve it up. In WordPress, I am a little unclear how to accomplish this. I am not sure if it fits well into the concepts of Posts and Pages.
I can perform the programming myself. I am just looking for some pointers on how to get started.
Thanks,
Carl
You can do that in WordPress, too. It's mostly just a plain old PHP site. For example, you could create a PHP file that creates the composite given the text and the image and use it like: <img src="/composite.php?image=...&text=...">.
Maybe all of the images are on a particular page or post type. Then you could create a custom page or post-type template that parses the $post->post_content for the images, does the compositing, and alters the image tags to point to the new composited images.
Or, more generally in that vein, create a filter for the_content that does that for all posts.
You might be able to hook into the WordPress upload system. As images are uploaded, you could create the composite. The wp_handle_upload filter might work for that.
Or you could even create a WordPress cron job that scans the media uploads for new entries and creates the composites then.