1 / 1 / 1 Регистрация: 30.09.2016 Сообщений: 27 |
|
1 |
|
07.03.2017, 02:42. Показов 2970. Ответов 6
Здравствуйте. Помогите пожалуйста решить эту задачу. Встали на ровном месте. Нужно загрузить картинки *bmp, но они сохранены в 256 .
__________________
0 |
пофигист широкого профиля 4602 / 3062 / 850 Регистрация: 15.07.2013 Сообщений: 17,660 |
|
07.03.2017, 03:12 |
2 |
При загрузке 256 битного изображения — ошибка. Код загрузки и скрин ошибки в студию.
0 |
1 / 1 / 1 Регистрация: 30.09.2016 Сообщений: 27 |
|
07.03.2017, 03:45 [ТС] |
3 |
Просто при попытке выбрать и загрузить изображение уже ошибка, та же что и если загружать картинку кодом. Миниатюры
0 |
5442 / 4266 / 1375 Регистрация: 14.04.2014 Сообщений: 19,204 Записей в блоге: 19 |
|
07.03.2017, 08:21 |
4 |
ну уж и картинку бы приложили б …
0 |
882 / 584 / 179 Регистрация: 28.02.2017 Сообщений: 2,359 Записей в блоге: 1 |
|
07.03.2017, 08:27 |
5 |
как можно загрузить 256 битную картинку Какую-какую?
1 |
КатяСаша 1 / 1 / 1 Регистрация: 30.09.2016 Сообщений: 27 |
||||||||
07.03.2017, 12:46 [ТС] |
6 |
|||||||
Да, ночью нужно спать Добавлено через 33 минуты в uses
0 |
5442 / 4266 / 1375 Регистрация: 14.04.2014 Сообщений: 19,204 Записей в блоге: 19 |
|
07.03.2017, 15:01 |
7 |
скачиваю в формате PNG, я её сохраняю на диск в формате BMP офигеть
0 |
IT_Exp Эксперт 87844 / 49110 / 22898 Регистрация: 17.06.2006 Сообщений: 92,604 |
07.03.2017, 15:01 |
7 |
how to convert JPEG to 24 bit depth???
Sep 30, 2011
1
A friend is applying for a visa, but the US government has these strange restrictions for only a 24bit photos submitted with the application. See the text below.
How can I convert a JPEG to 24 Bit? PS CS5 has 32 or 16 bit, not 24.
I am exporting the image as JPEG from LR3, but it only has options to save as 8 or 16 bit and not as JPEG.
Grrrr. Frustrating. Please help. And thanks
Here is the official US Government text:
Image Color Depth:
Image must be in color (24 bits per pixel). 24-bit black and white or 8-bit images will not be accepted.
Color photographs in 24-bit color depth are required. Color photographs may be downloaded from a camera to a file in the computer or they may be scanned onto a computer. If you are using a scanner, the settings must be for True Color or 24-bit color mode. See the additional scanning requirements below
kb2zuz
•
Veteran Member
•
Posts: 3,204
You’re already set.
It’s just a weird naming thing. Photoshop lists the bit depth as Bits/Channel. The government is asking for 24 bits total (not per channel). There are 3 channels in an RGB image. So a JPG (which by definition is an RGB image with 8bits/channel) will actually be a 24 bit image. No conversion necissary. Leave it as 8bit/channel in photoshop or lightroom and you’re fine.
—
~K
Nikon D800
Nikon AF-S Nikkor 14-24mm f/2.8G ED
Nikon AF Nikkor 50mm f/1.4D
Nikon AF-Nikkor 80-200mm f/2.8D ED
Epson Stylus Pro 3880
+6 more
Re: You’re already set.
In reply to kb2zuz
•
Sep 30, 2011
Thanks for the answer.
I am almost sure that the bureaucrat who wrote this has no idea what this means anyway, but its a way to make life difficult for the ordinary citizen.
Its is a visa lottery and they sift through applications for mistakes before allowing them to be part of the lottery.
This might be one way to reduce the amount of applicants
kb2zuz
wrote:It’s just a weird naming thing. Photoshop lists the bit depth as Bits/Channel. The government is asking for 24 bits total (not per channel). There are 3 channels in an RGB image. So a JPG (which by definition is an RGB image with 8bits/channel) will actually be a 24 bit image. No conversion necissary. Leave it as 8bit/channel in photoshop or lightroom and you’re fine.
—
~K
Re: how to convert JPEG to 24 bit depth???
1
How can someone at the Visa office look at a 2″x2″ printed portrait and tell it is 24 bit?
I would think it would be a major accomplishment for them to distinguish between BW and Color.
Actually, we computer geeks primarily used the term «24-bit color» back in the early 90s to refer to 8-bit RGB images (8-bits for each color channel, or, 3 x 8 = 24 bits.) In fact, my Epson scanner still lists «24-bit color», along with «color smoothing», «greyscale», and «black and white».
Don’t put too much into applicant filtering idea. It was just another common way of saying a common thing.
andrzej bialuski
wrote:
Thanks for the answer.I am almost sure that the bureaucrat who wrote this has no idea what this means anyway, but its a way to make life difficult for the ordinary citizen.
Its is a visa lottery and they sift through applications for mistakes before allowing them to be part of the lottery.
This might be one way to reduce the amount of applicants
kb2zuz
wrote:
Canon EOS-1D Mark II
Canon EOS 7D Mark II
Canon EOS 80D
Canon EOS 5D Mark IV
GoPro Hero7 Black
+6 more
Re: how to convert JPEG to 24 bit depth???
These are actually reasonable requirements.
andrzej bialuski
wrote:Here is the official US Government text:
Image Color Depth:
Image must be in color (24 bits per pixel).
Notice this is per pixel, not per channel.
24-bit black and white
They want color, not black and white.
or 8-bit images will not be accepted.
An example of what this would be like is if you saved the picture as a GIF. It must be quantized, resulting in a pixelated image. They could have just said color Jpeg.
— hide signature —
Canon EOS 5D
Canon EOS 5D Mark II
Canon EOS 600D
Canon EOS 5DS
Canon EF 50mm F1.8 II
+13 more
Re: how to convert JPEG to 24 bit depth???
davidford
wrote:How can someone at the Visa office look at a 2″x2″ printed portrait and tell it is 24 bit?
I would think it would be a major accomplishment for them to distinguish between BW and Color.
I think you can give them a bit more credit… those are digital submissions, not printed 2×2, and asking for a 24bit jpg, not horribly compressed are quite reasonable, but easy to meet requirements.
apaflo
•
Veteran Member
•
Posts: 3,854
Re: how to convert JPEG to 24 bit depth???
andrzej bialuski
wrote:Here is the official US Government text:
Image Color Depth:
Image must be in color (24 bits per pixel). 24-bit black and white or 8-bit images will not be accepted.
Color photographs in 24-bit color depth are required. Color photographs may be downloaded from a camera to a file in the computer or they may be scanned onto a computer. If you are using a scanner, the settings must be for True Color or 24-bit color mode. See the additional scanning requirements below
The above is a technically very specific (and very accurate) specification, clearly generated by some astute technical writer that knew what was required and how to state it correctly and absent ambiguity!
There are, however, two arbitrarily ambiguous possibilities in that specification. One is a lack of any pixel/inch specification. Which means it can either be extremely pixelated or it can be a JPEG with very low quality (high compression), either of which means a very poor quality image filled with artifacts. The second ambiguity is that while they require color and say no 24-bit black and white, there is nothing preventing an image that is significantly desaturated with barely any color visible.
Keyboard shortcuts:
FForum
MMy threads
Latest sample galleries
Latest in-depth reviews
The OM System M.Zuiko Digital ED 90mm F3.5 Macro IS PRO is finally here! Chris has opinions.
The Canon EOS R8 is the company’s latest mid-level full-frame mirrorless camera. It brings the sensor and autofocus from the EOS R6 II and combines them in a smaller, more affordable body.
The Canon EOS R50 is an entry-level, compact APS-C mirrorless camera. A 24MP RF-mount camera aiming to attract smartphone users and, perhaps, vloggers.
See what Chris and Jordan think of the Canon EOS R8 after shooting in Charleston, South Carolina.
The Canon EOS R50 is inexpensive. It’s tiny. Is it good? Jordan and Chris dodged alligators in South Carolina to find out.
Latest buying guides
Above $2500 cameras tend to become increasingly specialized, making it difficult to select a ‘best’ option. We case our eye over the options costing more than $2500 but less than $4000, to find the best all-rounder.
There are a lot of photo/video cameras that have found a role as B-cameras on professional film productions or even A-cameras for amateur and independent productions. We’ve combed through the options and selected our two favorite cameras in this class.
What’s the best camera for around $2000? These capable cameras should be solid and well-built, have both the speed and focus to capture fast action and offer professional-level image quality. In this buying guide we’ve rounded up all the current interchangeable lens cameras costing around $2000 and recommended the best.
Family moments are precious and sometimes you want to capture that time spent with loved ones or friends in better quality than your phone can manage. We’ve selected a group of cameras that are easy to keep with you, and that can adapt to take photos wherever and whenever something memorable happens.
What’s the best camera for shooting sports and action? Fast continuous shooting, reliable autofocus and great battery life are just three of the most important factors. In this buying guide we’ve rounded-up several great cameras for shooting sports and action, and recommended the best.
|
|
|
Загрузка изображения из БД «Bitmap is not valid»
- Подписаться на тему
- Сообщить другу
- Скачать/распечатать тему
|
|
есть таблица и в ней есть 3 поля типа «Поле объекта ОЛЕ» так вот изображения я помещать прямо в аксесе через CTRL+V и теперь хочу отобразить картинку через DBImage запускаю и выкатывается ошибка «Bitmap is not valid» на строчке procedure InvalidGraphic(Str: PResStringRec); begin raise EInvalidGraphic.CreateRes(Str); end; модуля Graphics что разве DBImage не поддерживает отображение картинок форматов jpg и bmp? |
dron-s |
|
а не пробывала считывать через поток картинку из БД? |
Сан Иваныч |
|
Оля! Не поленись полазить в ПОИСКЕ — работа с BLOB-полями |
olga90 |
|
если успользовать DBCtrlGrid с вкладки DataControls (он мне нужен для отображения по 5 записей из таблицы БД) значение ColCount = 1,значение RowCount = 5 и при отображении изображений из поля они во всех Имейджах одинаковые function GetStreamImgType(Stream: TStream): TGraphicClass; var StreamPos: int64; ImgSign: string; begin StreamPos := Stream.Position; try //BMP Result := Graphics.TBitmap; //JPEG SetLength(ImgSign, 4); Stream.Seek(6, soFromCurrent); Stream.Read(ImgSign[1],4); if (UpperCase(ImgSign) = ‘JFIF’) or (UpperCase(ImgSign) = ‘EXIF’) then begin Result := Jpeg.TJPEGImage; Exit; end; //WMF Stream.Position := StreamPos; SetLength(ImgSign, 4); Stream.Read(ImgSign[1],4); if ImgSign = #$D7#$CD#$C6#$9A then //see WMFKey begin Result := Graphics.TMetafile; Exit; end; //PNG Stream.Position := StreamPos; SetLength(ImgSign, 3); Stream.Seek(1, soFromCurrent); Stream.Read(ImgSign[1],3); if (UpperCase(ImgSign) = ‘PNG’) then begin Result := PNGImage.TPNGImage; Exit; end; finally Stream.Position := StreamPos; end; end; /// procedure LoadProperImage(Stream: TStream; Picture: TPicture); var Img: TGraphic; StreamPos: int64; begin StreamPos := Stream.Position; Img := GetStreamImgType(Stream).Create; try Stream.Position := StreamPos; Img.LoadFromStream(Stream); Wid := img.Width; hei := img.Height; Picture.Graphic := Img; finally Img.Free; end; end; function LoadPictureFromBLOB(Picture: TPicture; Field: TBlobField): boolean; var Stream: TStream; begin Result := False; if not Field.isNULL then begin Stream := TMemoryStream.Create; try Field.SaveToStream(Stream); Stream.Position := 0; LoadProperImage(Stream, Picture); Result := True; finally Stream.Free; end; end; end; и procedure TForm1.FormCreate(Sender: TObject); begin Image1.Picture.Bitmap.FreeImage; LoadPictureFromBLOB(image1.Picture, AdoTable1.FieldByName(‘SMALL_IMAGE’) as TBLOBField); end; получается что во всех имейджах одинаковые картинки как быть тогда |
olga90 |
|
а если кинуть компонент DBImage и выставить нужное поле, то в дизайн-тайме сразу отображается картинка этот компонент недоделанный что-ли |
volvo877 |
|
Оля, посмотри в Королевстве Дельфи, было довольно много обсуждений ошибки «Bitmap image is not valid». В частности — здесь: |
dron-s |
|
olga90 Image1.Picture.Bitmap.FreeImage; LoadPictureFromBLOB(image1.Picture, AdoTable1.FieldByName(‘SMALL_IMAGE’) as TBLOBField); на какое событие? |
olga90 |
|
Цитата dron-s @ 13.08.07, 14:32 olga90 Image1.Picture.Bitmap.FreeImage; LoadPictureFromBLOB(image1.Picture, AdoTable1.FieldByName(‘SMALL_IMAGE’) as TBLOBField); я уже писала — на onCreate формы |
dron-s |
|
Цитата olga90 @ 13.08.07, 16:28 я уже писала — на onCreate формы
ну и что ты тогда хочешь от этого кода? |
0 пользователей читают эту тему (0 гостей и 0 скрытых пользователей)
0 пользователей:
- Предыдущая тема
- Delphi: Базы данных
- Следующая тема
[ Script execution time: 0,0408 ] [ 16 queries used ] [ Generated: 9.02.23, 15:27 GMT ]
Войти или зарегистрироваться
Ошибка загрузки изображений Joomla «The file is not a valid image».
Тема в разделе «Ошибки при работе с Joomla», создана пользователем Wanderer, 25.03.2022.
- joomla
- джумла
-
Offline
Wanderer
Недавно здесь
- Регистрация:
- 08.07.2021
- Сообщения:
- 4
- Симпатии:
- 0
Здравствуйте, уважаемые форумчане!
При попытке загрузки изображений через админку Joomla отображается уведомление «The file is not a valid image». По этой причине я вынужден загружать изображения через ISPmanager, что не очень удобно и отнимает больше времени. Версия Joomla! 3.10.6, версия PHP 7.4.28. Может кто-то сталкивался с данной проблемой и знает, как ее решить? Буду очень признателен.Последнее редактирование: 25.03.2022
Wanderer,
25.03.2022
#1 -
Наши спонсоры
-
Offline
AKopytenko
Russian Joomla! Team
Команда форума- Регистрация:
- 01.09.2011
- Сообщения:
- 1 962
- Симпатии:
- 168
- Пол:
- Мужской
Как загружаешь картинки?
Материалы -> Медиа-менеджер -> Загрузить?
Если да, то на экране загрузок в правом верхнем углу есть кнопка «Настройки», далее стоит посмотреть, что написано в полях:- Разрешенные расширения
- Максимальный размер
- Разрешенные расширения изображений
- Разрешенные типы файлов (MIME)
- Запрещенные типы файлов (MIME)
Хотя, учитывая, что в языковых констандах стандартных расширений такой текст не найден («The file is not a valid image») — грузится не через менеджер
AKopytenko,
03.04.2022
#2 -
Offline
Asylum
Местный
=> Cпециалист <=- Регистрация:
- 09.02.2007
- Сообщения:
- 2 744
- Симпатии:
- 160
- Пол:
- Мужской
А что за изображения?
Можно сюда для примера?
Asylum,
09.04.2022
#3
(Вы должны войти или зарегистрироваться, чтобы ответить.)
FoxContact присылает код вместо письма
|
Джумла 4 не работает разделитель пунктов меню
>
Поделиться этой страницей
- Войти через Facebook
- Войти через Twitter
- Войти через Google
- Войти через VK (Вконтакте)
- Другие внешние сервисы…
- Ваше имя или e-mail:
- У Вас уже есть учётная запись?
-
- Нет, зарегистрироваться сейчас.
- Да, мой пароль:
-
Забыли пароль?
-
Запомнить меня
4.2.7
Поиск
-
- Искать только в заголовках
- Сообщения пользователя:
-
Имена участников (разделяйте запятой).
- Новее чем:
-
- Искать только в этой теме
- Искать только в этом разделе
- Отображать результаты в виде тем
-
Быстрый поиск
- Последние сообщения
Больше…
Хотите улучшить этот вопрос? Переформулируйте вопрос, чтобы он соответствовал тематике «Stack Overflow на русском».
Закрыт 4 года назад .
При попытке вставки изображений в БД, методом:
на второй строке, ошибка (за исключением файлов с расширением «bmp»):
«exception class EInvalidGraphic with message ‘Bitmap image is not valid’.»
Хотя, эти же изображения у меня загружаются и отображаются на convas формы, и компоненте «Image».
Библиотеки «GraphicEx», «jpeg» давно подключены.
В чем может быть проблема?
Hi all,
I’m trying to load an Image from OLE into a DBImage component and I get an error:
error: «Bitmap image is not valid»
How can I sort this out please?
Premium Content
Premium Content
- https://www.experts-exchange.com/questions/27069563/DBImage-error-Bitmap-image-is-not-valid.html copy
The OLE is adding its own stuff to the header of the image file which is not recognized by the standard image component.
Why do you need to use OLE in particular in this case? You can load images straight into the db field or even use the usual TImage component to load the image then save to db
Learn SQL Server Core 2016
This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.
yes, you set the type to BLOB (Binary Large OBject)
please note that using ADO with Access and BLOB fields is a bit trickier than other DB, as MS writes some stupid header (the path/name of the file. ), according to this article :
http://delphi.about.com/od/database/l/aa030601d.htm
but most of the time, with image and BLOB fields, that is quite simple : you generally use BLOBField.LoadFrom(File/St ream) to put the image in the DB, and SaveToStream to retrieve the data from the DB (and then use LoadFromStream in a TPicture object to display the image)
There are many different flavours of those pieces of code, but they are all alike. Details change upon the exact goal of the writer, the DB exact technology, and simple coding differences
I did not use that in MS Access DB before. You may read this article it might help you somehow.
I use Absolute Database Component which is much better than MS Access in different ways. If you try it you will like it.
If you want to give it a try here am attaching a simple project for storing/reading picture to/from DB.
If you need to convert the previous application to this one I will help.
PS: I had to rename one file to be able to attach this project, to be able to try it please rename it back.
Thread Tools
Search Thread
Display
- Linear Mode
- Switch to Hybrid Mode
- Switch to Threaded Mode
First of all, sorry for my english. I will try to make me understand.
I’m doing a program with CodeGear C++Builder 2009 that manages a few tables.
The tables were created with Database Desktop 7.0 (dbd32).
Between these tables there are a table whose name is ‘Evaluation’. His estructure is the follows:
http://img204.imageshack.us/img204/5281/61508099.jpg
The marked fields in red are the Graphics objects and its the fields that I think that nor work.
I do a Post() in this table and works it perfectly. But, when I do a few Post(), saving three or four images by instace, apper this error: Bitmap Image is not Valid.
http://img195.imageshack.us/img195/6606/78798525.jpg
This is the visual windows of my program where I save the instance of ‘Evaluation’.
http://img803.imageshack.us/img803/6075/74666256.jpg
Four of five photos can load in a Tabsheet with this code:
This DBImage have a DataSource and DataField correspondent with ‘Evaluation’.
Another of five images use an auxiliar DBImage to copy the content of another DBImage. The code that I use before the Post():
DBImage7 have DataSource and Datafield correspondent with ‘Evaluation’.
The format of this images is usually .jpeg or .jpg.
My question is: why leaves me save at the beginning and when I do a lot of instances throws this error?
The tables are not corrupted because I verified them with «Dr. Regener Paradox Table Repair 4».
Please. HELP. I am completely lost.
If you have not understood something, please, post and i will try to clarify.
Sorry but. I need the maximum help with this.
Well broadcasting (without cross-references) means everyone goes through the basics on EVERY forum (a big waste of effort).
Plenty of other people have questions as well, and if helpers are wasting time on yours, then someone else gets NO help at all.
Plus you also assume that we can figure out what you’re doing from just 5 lines of code (without any declarations).
Anyway, is this the interface you’re using?
TGraphic.LoadFromFile Method
If so, then the first thing I would suggest is adding the code to check for errors (or catch exceptions), and free up resources when you’re done.
Thank you for all and sorry for my mistakes. I’am a novice and I want to learn a lot of things.
I not sure of what do you want. Do I have to post all the code of my FORM?
if this is wrong, ask me to post any part of code in particular.
This is whole of code of this form Imageshack — 44149021.jpg :
I’m not particularly interested in wading through 1000’s of lines of GUI code, especially code with such poor indentation
What I will suggest however is that you create a simple console application to explore this aspect of the problem.
If this fails, you have a really simple code to post, and a really simple code to edit/debug as you explore why it fails.
When it works, you can compare the logic with your full GUI code to see if there is anything you missed.
If your GUI code subsequently fails, then it should be fairly certain that it has nothing to do with the image loading.
Every time you come across some unfamiliar concept, then it is worth investing the time in creating simple programs to explore that concept, just to make sure you understand it.
Thank you for all Salem. I learn so much about the posting in a programming forum. despite of your angry tone. Sorry for my mistakes.
From now I will try to help in this community.
About my problem. The error not is in the code.
When I try to save 4 images at same time in a TABLE,if among all these this space is more than 1 mega (more or less). the error, ‘Bitmap Image is not Valid’, is triggered.
I will try to find any solution.
Tell me, was there sufficient information in that huge code dump for me to be able to copy/paste into an EMPTY project and reproduce your problem?
If not, then there was little point in me spending time wading through it.
But if you still want to create huge programs which «surprise» don’t work the first time you run them, only to post sections of them on forums, and then blame people who try to help you for your failure, then good luck with that.
Very few people are willing to spend several HOURS on a single post (which is what your massive code dump full of irrelevant detail would have taken).
Short FOCUSED test programs exploring the key problem (for you) get the most interest (from us).
50 to 100 lines of nicely indented code is very easy to analyse, whereas your 100’s of lines of chaos is not.